From d06991d96031a4dd4c6c2245116aa5639738582c Mon Sep 17 00:00:00 2001 From: md_5 Date: Sun, 19 May 2019 19:17:56 +1000 Subject: [PATCH] SPIGOT-4953: Crafting table inventory returns player location, not block location --- nms-patches/ContainerWorkbench.patch | 7 ++++--- nms-patches/InventoryCrafting.patch | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/nms-patches/ContainerWorkbench.patch b/nms-patches/ContainerWorkbench.patch index 2134415f87..2653e2ddd7 100644 --- a/nms-patches/ContainerWorkbench.patch +++ b/nms-patches/ContainerWorkbench.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/server/ContainerWorkbench.java +++ b/net/minecraft/server/ContainerWorkbench.java -@@ -1,6 +1,10 @@ +@@ -1,13 +1,21 @@ package net.minecraft.server; import java.util.Optional; @@ -11,9 +11,10 @@ public class ContainerWorkbench extends ContainerRecipeBook { -@@ -8,6 +12,10 @@ + private final InventoryCrafting craftInventory; private final InventoryCraftResult resultInventory; - private final ContainerAccess e; +- private final ContainerAccess e; ++ public final ContainerAccess e; private final EntityHuman f; + // CraftBukkit start + private CraftInventoryView bukkitEntity = null; diff --git a/nms-patches/InventoryCrafting.patch b/nms-patches/InventoryCrafting.patch index 74d658695e..8557c6e662 100644 --- a/nms-patches/InventoryCrafting.patch +++ b/nms-patches/InventoryCrafting.patch @@ -62,7 +62,7 @@ + + @Override + public Location getLocation() { -+ return owner.getBukkitEntity().getLocation(); ++ return container instanceof ContainerWorkbench ? ((ContainerWorkbench) container).e.getLocation() : owner.getBukkitEntity().getLocation(); + } + + @Override