diff options
Diffstat (limited to 'patch-remap/mache-spigotflower-stripped/net/minecraft/world/inventory/CartographyTableMenu.java.patch')
-rw-r--r-- | patch-remap/mache-spigotflower-stripped/net/minecraft/world/inventory/CartographyTableMenu.java.patch | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/patch-remap/mache-spigotflower-stripped/net/minecraft/world/inventory/CartographyTableMenu.java.patch b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/inventory/CartographyTableMenu.java.patch new file mode 100644 index 0000000000..13a6e37f71 --- /dev/null +++ b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/inventory/CartographyTableMenu.java.patch @@ -0,0 +1,76 @@ +--- a/net/minecraft/world/inventory/CartographyTableMenu.java ++++ b/net/minecraft/world/inventory/CartographyTableMenu.java +@@ -11,9 +10,30 @@ + import net.minecraft.world.item.MapItem; + import net.minecraft.world.level.block.Blocks; + import net.minecraft.world.level.saveddata.maps.MapItemSavedData; ++// CraftBukkit start ++import org.bukkit.Location; ++import org.bukkit.craftbukkit.inventory.CraftInventoryCartography; ++import org.bukkit.craftbukkit.inventory.CraftInventoryView; ++import org.bukkit.entity.Player; ++// CraftBukkit end + + public class CartographyTableMenu extends AbstractContainerMenu { + ++ // CraftBukkit start ++ private CraftInventoryView bukkitEntity = null; ++ private Player player; ++ ++ @Override ++ public CraftInventoryView getBukkitView() { ++ if (bukkitEntity != null) { ++ return bukkitEntity; ++ } ++ ++ CraftInventoryCartography inventory = new CraftInventoryCartography(this.container, this.resultContainer); ++ bukkitEntity = new CraftInventoryView(this.player, inventory, this); ++ return bukkitEntity; ++ } ++ // CraftBukkit end + public static final int MAP_SLOT = 0; + public static final int ADDITIONAL_SLOT = 1; + public static final int RESULT_SLOT = 2; +@@ -39,6 +58,13 @@ + CartographyTableMenu.this.slotsChanged(this); + super.setChanged(); + } ++ ++ // CraftBukkit start ++ @Override ++ public Location getLocation() { ++ return access.getLocation(); ++ } ++ // CraftBukkit end + }; + this.resultContainer = new ResultContainer() { + @Override +@@ -47,6 +72,13 @@ + CartographyTableMenu.this.slotsChanged(this); + super.setChanged(); + } ++ ++ // CraftBukkit start ++ @Override ++ public Location getLocation() { ++ return access.getLocation(); ++ } ++ // CraftBukkit end + }; + this.access = containerlevelaccess; + this.addSlot(new Slot(this.container, 0, 15, 15) { +@@ -101,11 +129,12 @@ + this.addSlot(new Slot(inventory, j, 8 + j * 18, 142)); + } + ++ player = (Player) playerInventory.player.getBukkitEntity(); // CraftBukkit + } + + @Override +- @Override +- public boolean stillValid(Player player) { ++ public boolean stillValid(net.minecraft.world.entity.player.Player player) { ++ if (!this.checkReachable) return true; // CraftBukkit + return stillValid(this.access, player, Blocks.CARTOGRAPHY_TABLE); + } + |