summaryrefslogtreecommitdiffstats
path: root/src/main/java/org
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2018-07-31 09:14:44 +1000
committermd_5 <git@md-5.net>2018-07-31 09:14:44 +1000
commit03c1273b59919bd780693dd96500426e3e4804aa (patch)
treefda984d874cc50b9b51a704bbc48b682826cd9b6 /src/main/java/org
parent8592585b9f160e753e8ccce9a7275de33265acec (diff)
downloadcraftbukkit-03c1273b59919bd780693dd96500426e3e4804aa.tar
craftbukkit-03c1273b59919bd780693dd96500426e3e4804aa.tar.gz
craftbukkit-03c1273b59919bd780693dd96500426e3e4804aa.tar.lz
craftbukkit-03c1273b59919bd780693dd96500426e3e4804aa.tar.xz
craftbukkit-03c1273b59919bd780693dd96500426e3e4804aa.zip
SPIGOT-4197: Account for double trapped chests
Diffstat (limited to 'src/main/java/org')
-rw-r--r--src/main/java/org/bukkit/craftbukkit/block/CraftChest.java3
1 files changed, 2 insertions, 1 deletions
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<TileEntityChest> 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);