From 1d74403327235004ff05260d18efe4f573a69883 Mon Sep 17 00:00:00 2001 From: Phoenix616 Date: Thu, 3 Sep 2020 18:37:55 +1000 Subject: [PATCH] #745: Fix getLocation for Cartography Table and Stonecutter --- nms-patches/ContainerCartography.patch | 18 ++++++++++++++++-- nms-patches/ContainerStonecutter.patch | 21 ++++++++++++++++++--- 2 files changed, 34 insertions(+), 5 deletions(-) diff --git a/nms-patches/ContainerCartography.patch b/nms-patches/ContainerCartography.patch index 9b6587a7dd..86b965eb95 100644 --- a/nms-patches/ContainerCartography.patch +++ b/nms-patches/ContainerCartography.patch @@ -30,7 +30,21 @@ private final ContainerAccess containerAccess; private long e; public final IInventory inventory; -@@ -26,6 +48,13 @@ +@@ -19,6 +41,13 @@ + ContainerCartography.this.a((IInventory) this); + super.update(); + } ++ ++ // CraftBukkit start ++ @Override ++ public Location getLocation() { ++ return containeraccess.getLocation(); ++ } ++ // CraftBukkit end + }; + this.resultInventory = new InventoryCraftResult() { + @Override +@@ -26,6 +55,13 @@ ContainerCartography.this.a((IInventory) this); super.update(); } @@ -44,7 +58,7 @@ }; this.containerAccess = containeraccess; this.a(new Slot(this.inventory, 0, 15, 15) { -@@ -78,10 +107,12 @@ +@@ -78,10 +114,12 @@ this.a(new Slot(playerinventory, j, 8 + j * 18, 142)); } diff --git a/nms-patches/ContainerStonecutter.patch b/nms-patches/ContainerStonecutter.patch index 3ae0ad8155..ff24b9507b 100644 --- a/nms-patches/ContainerStonecutter.patch +++ b/nms-patches/ContainerStonecutter.patch @@ -1,10 +1,11 @@ --- a/net/minecraft/server/ContainerStonecutter.java +++ b/net/minecraft/server/ContainerStonecutter.java -@@ -2,6 +2,11 @@ +@@ -2,6 +2,12 @@ import com.google.common.collect.Lists; import java.util.List; +// CraftBukkit start ++import org.bukkit.Location; +import org.bukkit.craftbukkit.inventory.CraftInventoryStonecutter; +import org.bukkit.craftbukkit.inventory.CraftInventoryView; +import org.bukkit.entity.Player; @@ -12,7 +13,7 @@ public class ContainerStonecutter extends Container { -@@ -16,6 +21,21 @@ +@@ -16,6 +22,21 @@ private Runnable l; public final IInventory inventory; private final InventoryCraftResult resultInventory; @@ -34,7 +35,21 @@ public ContainerStonecutter(int i, PlayerInventory playerinventory) { this(i, playerinventory, ContainerAccess.a); -@@ -82,10 +102,12 @@ +@@ -35,6 +56,13 @@ + ContainerStonecutter.this.a((IInventory) this); + ContainerStonecutter.this.l.run(); + } ++ ++ // CraftBukkit start ++ @Override ++ public Location getLocation() { ++ return containeraccess.getLocation(); ++ } ++ // CraftBukkit end + }; + this.resultInventory = new InventoryCraftResult(); + this.containerAccess = containeraccess; +@@ -82,10 +110,12 @@ } this.a(this.containerProperty);