From 03c1273b59919bd780693dd96500426e3e4804aa Mon Sep 17 00:00:00 2001 From: md_5 Date: Tue, 31 Jul 2018 09:14:44 +1000 Subject: SPIGOT-4197: Account for double trapped chests --- src/main/java/org/bukkit/craftbukkit/block/CraftChest.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java b/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java index 6a54f2a1..dff5bb51 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java @@ -52,7 +52,8 @@ public class CraftChest extends CraftLootable implements Chest int z = this.getZ(); CraftWorld world = (CraftWorld) this.getWorld(); - ITileInventory nms = ((BlockChest) Blocks.CHEST).getInventory(data, world.getHandle(), new BlockPosition(x, y, z), true); + BlockChest blockChest = (BlockChest) (this.getType() == Material.CHEST ? Blocks.CHEST : Blocks.TRAPPED_CHEST); + ITileInventory nms = blockChest.getInventory(data, world.getHandle(), new BlockPosition(x, y, z), true); if (nms instanceof InventoryLargeChest) { inventory = new CraftInventoryDoubleChest((InventoryLargeChest) nms); -- cgit v1.2.3