From d0494aa2e7b78c967b3623a5aace6d5e28ac5738 Mon Sep 17 00:00:00 2001 From: Hummer12007 Date: Tue, 13 Jan 2015 21:48:27 +0200 Subject: [PATCH 1/2] Fix trapped chests linking with ordinary chests, instead of trapped ones. --- .../com/lishid/openinv/internal/v1_8_R1/AnySilentChest.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/lishid/openinv/internal/v1_8_R1/AnySilentChest.java b/src/main/java/com/lishid/openinv/internal/v1_8_R1/AnySilentChest.java index 239bb01..46dfd81 100644 --- a/src/main/java/com/lishid/openinv/internal/v1_8_R1/AnySilentChest.java +++ b/src/main/java/com/lishid/openinv/internal/v1_8_R1/AnySilentChest.java @@ -90,7 +90,8 @@ public class AnySilentChest implements IAnySilentChest { return true; } - BlockChest chest = (BlockChest) Block.getByName("chest"); + BlockChest chest = (BlockChest) (((BlockChest) world.getType(position).getBlock()).b == 1 ? + Block.getByName("trapped_chest") : Block.getByName("chest")); TileEntity tileEntity = world.getTileEntity(position); if (!(tileEntity instanceof TileEntityChest)) { From ec3426b8278ecc68814974350216804ab11ac4d9 Mon Sep 17 00:00:00 2001 From: Hummer12007 Date: Tue, 13 Jan 2015 21:55:03 +0200 Subject: [PATCH 2/2] Use the same method for getting BlockChest, when checking whether AnyChest is needed due to the side block as in d0494aa2 --- .../com/lishid/openinv/internal/v1_8_R1/AnySilentChest.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/lishid/openinv/internal/v1_8_R1/AnySilentChest.java b/src/main/java/com/lishid/openinv/internal/v1_8_R1/AnySilentChest.java index 46dfd81..30756a7 100644 --- a/src/main/java/com/lishid/openinv/internal/v1_8_R1/AnySilentChest.java +++ b/src/main/java/com/lishid/openinv/internal/v1_8_R1/AnySilentChest.java @@ -35,7 +35,8 @@ public class AnySilentChest implements IAnySilentChest { BlockPosition position = new BlockPosition(x, y, z); EntityPlayer player = ((CraftPlayer) p).getHandle(); World world = player.world; - BlockChest chest = (BlockChest) Block.getByName("chest"); + BlockChest chest = (BlockChest) (((BlockChest) world.getType(position).getBlock()).b == 1 ? + Block.getByName("trapped_chest") : Block.getByName("chest")); // If block on top if (topBlocking(world, position)) {