aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/og/net/minecraft/world/inventory/ContainerCartography.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/og/net/minecraft/world/inventory/ContainerCartography.patch')
-rw-r--r--patch-remap/og/net/minecraft/world/inventory/ContainerCartography.patch74
1 files changed, 74 insertions, 0 deletions
diff --git a/patch-remap/og/net/minecraft/world/inventory/ContainerCartography.patch b/patch-remap/og/net/minecraft/world/inventory/ContainerCartography.patch
new file mode 100644
index 0000000000..0a48c9eda0
--- /dev/null
+++ b/patch-remap/og/net/minecraft/world/inventory/ContainerCartography.patch
@@ -0,0 +1,74 @@
+--- a/net/minecraft/world/inventory/ContainerCartography.java
++++ b/net/minecraft/world/inventory/ContainerCartography.java
+@@ -12,8 +12,30 @@
+ import net.minecraft.world.level.block.Blocks;
+ import net.minecraft.world.level.saveddata.maps.WorldMap;
+
++// 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 ContainerCartography extends Container {
+
++ // 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;
+@@ -38,6 +60,13 @@
+ ContainerCartography.this.slotsChanged(this);
+ super.setChanged();
+ }
++
++ // CraftBukkit start
++ @Override
++ public Location getLocation() {
++ return containeraccess.getLocation();
++ }
++ // CraftBukkit end
+ };
+ this.resultContainer = new InventoryCraftResult() {
+ @Override
+@@ -45,6 +74,13 @@
+ ContainerCartography.this.slotsChanged(this);
+ super.setChanged();
+ }
++
++ // CraftBukkit start
++ @Override
++ public Location getLocation() {
++ return containeraccess.getLocation();
++ }
++ // CraftBukkit end
+ };
+ this.access = containeraccess;
+ this.addSlot(new Slot(this.container, 0, 15, 15) {
+@@ -95,10 +131,12 @@
+ this.addSlot(new Slot(playerinventory, j, 8 + j * 18, 142));
+ }
+
++ player = (Player) playerinventory.player.getBukkitEntity(); // CraftBukkit
+ }
+
+ @Override
+ public boolean stillValid(EntityHuman entityhuman) {
++ if (!this.checkReachable) return true; // CraftBukkit
+ return stillValid(this.access, entityhuman, Blocks.CARTOGRAPHY_TABLE);
+ }
+