From 00d070116662d16984ea35a57466bf67a8a14875 Mon Sep 17 00:00:00 2001 From: Christian Date: Fri, 29 Jun 2012 13:11:20 -0400 Subject: [PATCH] Fix reflection --- IronChests2/common/cpw/mods/ironchest/ItemChestChanger.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/IronChests2/common/cpw/mods/ironchest/ItemChestChanger.java b/IronChests2/common/cpw/mods/ironchest/ItemChestChanger.java index 279c6d4..73ff892 100644 --- a/IronChests2/common/cpw/mods/ironchest/ItemChestChanger.java +++ b/IronChests2/common/cpw/mods/ironchest/ItemChestChanger.java @@ -10,6 +10,7 @@ ******************************************************************************/ package cpw.mods.ironchest; +import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.ReflectionHelper; import net.minecraft.src.EntityPlayer; import net.minecraft.src.Item; @@ -51,7 +52,7 @@ public class ItemChestChanger extends Item implements ITextureProvider { } newchest = IronChestType.makeEntity(getTargetChestOrdinal(IronChestType.WOOD.ordinal())); int newSize = newchest.chestContents.length; - ItemStack[] chestContents = ReflectionHelper.getPrivateValue(TileEntityChest.class, tec, "chestContents"); + ItemStack[] chestContents = ReflectionHelper.getPrivateValue(TileEntityChest.class, tec, 0); System.arraycopy(chestContents, 0, newchest.chestContents, 0, Math.min(newSize, chestContents.length)); BlockIronChest block = mod_IronChest.ironChestBlock; block.dropContent(newSize, tec, world, tec.xCoord, tec.yCoord, tec.zCoord);