From 115ad9e31a9ed0c3a7987044c352e38ce096cbbf Mon Sep 17 00:00:00 2001 From: Chicken-Bones Date: Fri, 29 May 2015 18:05:13 +1000 Subject: [PATCH] Some inventory stuff moved --- build/build.properties | 6 +++--- src/codechicken/nei/ContainerPotionCreator.java | 14 ++++++-------- src/codechicken/nei/NEICPH.java | 4 ---- src/codechicken/nei/NEIDummySlotHandler.java | 4 ++-- src/codechicken/nei/NEISPH.java | 11 +---------- 5 files changed, 12 insertions(+), 27 deletions(-) diff --git a/build/build.properties b/build/build.properties index 84d2f7e1..57d7f03d 100644 --- a/build/build.properties +++ b/build/build.properties @@ -1,5 +1,5 @@ mc_version=1.7.10 forge_version=10.13.0.1151 -ccl_version=1.1.3.136 -ccc_version=1.0.6.+ -mod_version=1.0.4 +ccl_version=1.1.3.138 +ccc_version=1.0.7.+ +mod_version=1.0.5 diff --git a/src/codechicken/nei/ContainerPotionCreator.java b/src/codechicken/nei/ContainerPotionCreator.java index e6b7c9a5..d89f82cb 100644 --- a/src/codechicken/nei/ContainerPotionCreator.java +++ b/src/codechicken/nei/ContainerPotionCreator.java @@ -1,7 +1,7 @@ package codechicken.nei; -import codechicken.core.inventory.ContainerExtended; -import codechicken.core.inventory.SlotHandleClicks; +import codechicken.lib.inventory.ContainerExtended; +import codechicken.lib.inventory.SlotHandleClicks; import codechicken.lib.inventory.InventoryNBT; import codechicken.lib.inventory.InventoryUtils; import codechicken.lib.packet.PacketCustom; @@ -123,12 +123,12 @@ public class ContainerPotionCreator extends ContainerExtended @SuppressWarnings("unchecked") @Override - public void handleInputPacket(PacketCustom packet) { + public void handleServerPacket(PacketCustom packet) { ItemStack potion = potionInv.getStackInSlot(0); if (potion == null) return; - boolean add = packet.readBoolean(); + boolean add = packet.getType() == 3; int effectID = packet.readUByte(); NBTTagList effects = potion.getTagCompound().getTagList("CustomPotionEffects", 10); @@ -145,8 +145,7 @@ public class ContainerPotionCreator extends ContainerExtended } public void setPotionEffect(int effectID, int duration, int amplifier) { - PacketCustom packet = NEICPH.createContainerPacket(); - packet.writeBoolean(true); + PacketCustom packet = getPacket(3); packet.writeByte(effectID); packet.writeInt(duration); packet.writeByte(amplifier); @@ -154,8 +153,7 @@ public class ContainerPotionCreator extends ContainerExtended } public void removePotionEffect(int effectID) { - PacketCustom packet = NEICPH.createContainerPacket(); - packet.writeBoolean(false); + PacketCustom packet = getPacket(2); packet.writeByte(effectID); packet.sendToServer(); } diff --git a/src/codechicken/nei/NEICPH.java b/src/codechicken/nei/NEICPH.java index 4ff7d46d..e231b4b1 100644 --- a/src/codechicken/nei/NEICPH.java +++ b/src/codechicken/nei/NEICPH.java @@ -227,10 +227,6 @@ public class NEICPH implements IClientPacketHandler packet.sendToServer(); } - public static PacketCustom createContainerPacket() { - return new PacketCustom(channel, 20); - } - public static void sendOpenPotionWindow() { ItemStack[] potionStore = new ItemStack[9]; InventoryUtils.readItemStacksFromTag(potionStore, NEIClientConfig.global.nbt.getCompoundTag("potionStore").getTagList("items", 10)); diff --git a/src/codechicken/nei/NEIDummySlotHandler.java b/src/codechicken/nei/NEIDummySlotHandler.java index 0c658e94..3c49d73a 100644 --- a/src/codechicken/nei/NEIDummySlotHandler.java +++ b/src/codechicken/nei/NEIDummySlotHandler.java @@ -1,7 +1,7 @@ package codechicken.nei; -import codechicken.core.inventory.ContainerExtended; -import codechicken.core.inventory.SlotDummy; +import codechicken.lib.inventory.ContainerExtended; +import codechicken.lib.inventory.SlotDummy; import codechicken.nei.api.INEIGuiAdapter; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.inventory.Slot; diff --git a/src/codechicken/nei/NEISPH.java b/src/codechicken/nei/NEISPH.java index 4bc606c4..b3bc52da 100644 --- a/src/codechicken/nei/NEISPH.java +++ b/src/codechicken/nei/NEISPH.java @@ -3,8 +3,7 @@ package codechicken.nei; import codechicken.core.CommonUtils; import codechicken.core.IGuiPacketSender; import codechicken.core.ServerUtils; -import codechicken.core.inventory.ContainerExtended; -import codechicken.core.inventory.SlotDummy; +import codechicken.lib.inventory.SlotDummy; import codechicken.lib.packet.PacketCustom; import codechicken.lib.packet.PacketCustom.IServerPacketHandler; import codechicken.lib.vec.BlockCoord; @@ -69,9 +68,6 @@ public class NEISPH implements IServerPacketHandler case 15: handleMobSpawnerID(sender.worldObj, packet.readCoord(), packet.readString()); break; - case 20: - handleContainerPacket(sender, packet); - break; case 21: openEnchantmentGui(sender); break; @@ -99,11 +95,6 @@ public class NEISPH implements IServerPacketHandler slot.putStack(stack); } - private void handleContainerPacket(EntityPlayerMP sender, PacketCustom packet) { - if (sender.openContainer instanceof ContainerExtended) - ((ContainerExtended) sender.openContainer).handleInputPacket(packet); - } - private void handleMobSpawnerID(World world, BlockCoord coord, String mobtype) { TileEntity tile = world.getTileEntity(coord.x, coord.y, coord.z); if (tile instanceof TileEntityMobSpawner) {