From 4316a8c246428aa7cf154198efe18d2252971651 Mon Sep 17 00:00:00 2001 From: md_5 Date: Wed, 8 Mar 2017 17:56:08 +1100 Subject: [PATCH] SPIGOT-3110: SHULKER_BOX InventoryType --- .../org/bukkit/craftbukkit/entity/CraftHumanEntity.java | 7 +++++++ .../org/bukkit/craftbukkit/inventory/CraftInventory.java | 3 +++ 2 files changed, 10 insertions(+) diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java index 581a4394d9..0397756cd5 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java @@ -250,6 +250,13 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { openCustomInventory(inventory, player, "minecraft:anvil"); } break; + case SHULKER_BOX: + if (iinventory instanceof TileEntityShulkerBox) { + getHandle().openTileEntity((TileEntityShulkerBox) iinventory); + } else { + openCustomInventory(inventory, player, "minecraft:shulker_box"); + } + break; case CREATIVE: case CRAFTING: throw new IllegalArgumentException("Can't open a " + type + " inventory!"); diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java index 0033246bb3..89e47bb355 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java @@ -15,6 +15,7 @@ import net.minecraft.server.TileEntityBrewingStand; import net.minecraft.server.TileEntityDispenser; import net.minecraft.server.TileEntityDropper; import net.minecraft.server.TileEntityFurnace; +import net.minecraft.server.TileEntityShulkerBox; import org.apache.commons.lang.Validate; import org.bukkit.Location; @@ -462,6 +463,8 @@ public class CraftInventory implements Inventory { return InventoryType.ANVIL; } else if (inventory instanceof IHopper) { return InventoryType.HOPPER; + } else if (inventory instanceof TileEntityShulkerBox) { + return InventoryType.SHULKER_BOX; } else { return InventoryType.CHEST; }