From 1734f378f7ef5e0554790d36626c4904b94270c1 Mon Sep 17 00:00:00 2001 From: md_5 Date: Wed, 30 Jan 2019 11:10:04 +1100 Subject: [PATCH] SPIGOT-4598: Shift click on custom workbench inventory causes crash --- .../org/bukkit/craftbukkit/inventory/CraftContainer.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java index 38175385f3..4c71d9fea1 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java @@ -17,6 +17,7 @@ import net.minecraft.server.ContainerEnchantTable; import net.minecraft.server.ContainerFurnace; import net.minecraft.server.ContainerHopper; import net.minecraft.server.ContainerShulkerBox; +import net.minecraft.server.ContainerWorkbench; import net.minecraft.server.EntityHuman; import net.minecraft.server.IInventory; import net.minecraft.server.ItemStack; @@ -175,6 +176,11 @@ public class CraftContainer extends Container { this.items = delegate.items; this.slots = delegate.slots; } + + // SPIGOT-4598 - we should still delegate the shift click handler + if (cachedType == InventoryType.WORKBENCH) { + delegate = new ContainerWorkbench(bottom, entityhuman.world, entityhuman.getChunkCoordinates()); + } } private void setupWorkbench(IInventory top, IInventory bottom) {