From a948368ee57e5f779413779c79d913f44314c7e1 Mon Sep 17 00:00:00 2001 From: Nuchaz Date: Sat, 12 Feb 2022 15:38:57 -0500 Subject: [PATCH] Fixed the atlas waypoint and issues with atlas packets on a server (#10) --- src/main/java/jds/bibliocraft/ClientProxy.java | 1 + .../bibliocraft/network/packet/server/BiblioUpdateInv.java | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/jds/bibliocraft/ClientProxy.java b/src/main/java/jds/bibliocraft/ClientProxy.java index 0df8557..890fd6c 100644 --- a/src/main/java/jds/bibliocraft/ClientProxy.java +++ b/src/main/java/jds/bibliocraft/ClientProxy.java @@ -175,6 +175,7 @@ public class ClientProxy extends CommonProxy { + @SuppressWarnings("unchecked") public void registerRenderers() { MinecraftForge.EVENT_BUS.register(TextureStichHandler.instance); diff --git a/src/main/java/jds/bibliocraft/network/packet/server/BiblioUpdateInv.java b/src/main/java/jds/bibliocraft/network/packet/server/BiblioUpdateInv.java index f9c460b..67c9514 100644 --- a/src/main/java/jds/bibliocraft/network/packet/server/BiblioUpdateInv.java +++ b/src/main/java/jds/bibliocraft/network/packet/server/BiblioUpdateInv.java @@ -12,6 +12,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; +import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumHand; import net.minecraftforge.common.util.Constants; import net.minecraftforge.fml.common.network.ByteBufUtils; @@ -62,8 +63,10 @@ public IMessage onMessage(BiblioUpdateInv message, MessageContext ctx) { for (int i = 0; i <= list.tagCount(); i++) { - Item testItem = new ItemStack(list.getCompoundTagAt(i)).getItem(); - if (!(testItem instanceof ItemEmptyMap || testItem instanceof ItemMap || testItem instanceof ItemWaypointCompass)) + ItemStack testStack = new ItemStack(list.getCompoundTagAt(i)); + Item testItem = testStack.getItem(); + System.out.println(testItem.getUnlocalizedName()); + if (!testStack.isEmpty() && !(testItem instanceof ItemEmptyMap || testItem instanceof ItemMap || testItem instanceof ItemWaypointCompass)) { safe = false; }