From 33a406311f475e73d65a5fb7b53594587ef13e9d Mon Sep 17 00:00:00 2001 From: Taylor Shuler Date: Sun, 3 Aug 2014 21:13:13 +0100 Subject: [PATCH] Removed unnecessary slot stuff --- .../mods/ironchest/ContainerIronChest.java | 6 +++--- .../cpw/mods/ironchest/IronChestType.java | 14 ++----------- .../cpw/mods/ironchest/ValidatingSlot.java | 21 ------------------- 3 files changed, 5 insertions(+), 36 deletions(-) delete mode 100644 src/main/java/cpw/mods/ironchest/ValidatingSlot.java diff --git a/src/main/java/cpw/mods/ironchest/ContainerIronChest.java b/src/main/java/cpw/mods/ironchest/ContainerIronChest.java index d9fe63d..a4f99c7 100644 --- a/src/main/java/cpw/mods/ironchest/ContainerIronChest.java +++ b/src/main/java/cpw/mods/ironchest/ContainerIronChest.java @@ -1,12 +1,12 @@ package cpw.mods.ironchest; +import invtweaks.api.container.ChestContainer; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; -import invtweaks.api.container.ChestContainer; @ChestContainer(isLargeChest = true) public class ContainerIronChest extends Container { @@ -75,13 +75,13 @@ public class ContainerIronChest extends Container { protected void layoutContainer(IInventory playerInventory, IInventory chestInventory, IronChestType type, int xSize, int ySize) { if (type == IronChestType.DIRTCHEST9000) { - addSlotToContainer(type.makeSlot(chestInventory, 0, 12 + 4 * 18, 8 + 2 * 18)); + addSlotToContainer(new Slot(chestInventory, 0, 12 + 4 * 18, 8 + 2 * 18)); } else { for (int chestRow = 0; chestRow < type.getRowCount(); chestRow++) { for (int chestCol = 0; chestCol < type.getRowLength(); chestCol++) { - addSlotToContainer(type.makeSlot(chestInventory, chestCol + chestRow * type.getRowLength(), 12 + chestCol * 18, 8 + chestRow * 18)); + addSlotToContainer(new Slot(chestInventory, chestCol + chestRow * type.getRowLength(), 12 + chestCol * 18, 8 + chestRow * 18)); } } } diff --git a/src/main/java/cpw/mods/ironchest/IronChestType.java b/src/main/java/cpw/mods/ironchest/IronChestType.java index 7435262..8c1bb73 100644 --- a/src/main/java/cpw/mods/ironchest/IronChestType.java +++ b/src/main/java/cpw/mods/ironchest/IronChestType.java @@ -3,11 +3,10 @@ package cpw.mods.ironchest; import java.util.ArrayList; import java.util.Arrays; import java.util.List; + import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.init.Blocks; import net.minecraft.init.Items; -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.Slot; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagByte; @@ -94,10 +93,6 @@ public enum IronChestType { return null; } - public static void registerTranslations() - { - } - public static void registerBlocksAndRecipes(BlockIronChest blockResult) { ItemStack previous = new ItemStack(Blocks.chest); @@ -229,22 +224,17 @@ public enum IronChestType { @SideOnly(Side.CLIENT) public IIcon getIcon(int side) { - return icons[sideMapping[side]]; } private static String[] sideNames = { "top", "front", "side" }; private static int[] sideMapping = { 0, 0, 2, 1, 2, 2, 2 }; - public Slot makeSlot(IInventory chestInventory, int index, int x, int y) - { - return new ValidatingSlot(chestInventory, index, x, y, this); - } - public boolean acceptsStack(ItemStack itemstack) { return itemFilter == null || itemstack == null || itemstack.getItem() == itemFilter; } + public void adornItemDrop(ItemStack item) { if (this == DIRTCHEST9000) diff --git a/src/main/java/cpw/mods/ironchest/ValidatingSlot.java b/src/main/java/cpw/mods/ironchest/ValidatingSlot.java deleted file mode 100644 index f0348c9..0000000 --- a/src/main/java/cpw/mods/ironchest/ValidatingSlot.java +++ /dev/null @@ -1,21 +0,0 @@ -package cpw.mods.ironchest; - -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; - -public class ValidatingSlot extends Slot { - private IronChestType type; - - public ValidatingSlot(IInventory par1iInventory, int par2, int par3, int par4, IronChestType type) - { - super(par1iInventory, par2, par3, par4); - this.type = type; - } - - @Override - public boolean isItemValid(ItemStack par1ItemStack) - { - return type.acceptsStack(par1ItemStack); - } -}