Commits

Phoenix616 authored and md_5 committed 1d744033272
#745: Fix getLocation for Cartography Table and Stonecutter
No tags

nms-patches/ContainerCartography.patch

Modified
23 23 + }
24 24 +
25 25 + CraftInventoryCartography inventory = new CraftInventoryCartography(this.inventory, this.resultInventory);
26 26 + bukkitEntity = new CraftInventoryView(this.player, inventory, this);
27 27 + return bukkitEntity;
28 28 + }
29 29 + // CraftBukkit end
30 30 private final ContainerAccess containerAccess;
31 31 private long e;
32 32 public final IInventory inventory;
33 -@@ -26,6 +48,13 @@
33 +@@ -19,6 +41,13 @@
34 + ContainerCartography.this.a((IInventory) this);
35 + super.update();
36 + }
37 ++
38 ++ // CraftBukkit start
39 ++ @Override
40 ++ public Location getLocation() {
41 ++ return containeraccess.getLocation();
42 ++ }
43 ++ // CraftBukkit end
44 + };
45 + this.resultInventory = new InventoryCraftResult() {
46 + @Override
47 +@@ -26,6 +55,13 @@
34 48 ContainerCartography.this.a((IInventory) this);
35 49 super.update();
36 50 }
37 51 +
38 52 + // CraftBukkit start
39 53 + @Override
40 54 + public Location getLocation() {
41 55 + return containeraccess.getLocation();
42 56 + }
43 57 + // CraftBukkit end
44 58 };
45 59 this.containerAccess = containeraccess;
46 60 this.a(new Slot(this.inventory, 0, 15, 15) {
47 -@@ -78,10 +107,12 @@
61 +@@ -78,10 +114,12 @@
48 62 this.a(new Slot(playerinventory, j, 8 + j * 18, 142));
49 63 }
50 64
51 65 + player = (Player) playerinventory.player.getBukkitEntity(); // CraftBukkit
52 66 }
53 67
54 68 @Override
55 69 public boolean canUse(EntityHuman entityhuman) {
56 70 + if (!this.checkReachable) return true; // CraftBukkit
57 71 return a(this.containerAccess, entityhuman, Blocks.CARTOGRAPHY_TABLE);

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut