aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-spigotflower-stripped/net/minecraft/world/inventory/ChestMenu.java.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/mache-spigotflower-stripped/net/minecraft/world/inventory/ChestMenu.java.patch')
-rw-r--r--patch-remap/mache-spigotflower-stripped/net/minecraft/world/inventory/ChestMenu.java.patch45
1 files changed, 45 insertions, 0 deletions
diff --git a/patch-remap/mache-spigotflower-stripped/net/minecraft/world/inventory/ChestMenu.java.patch b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/inventory/ChestMenu.java.patch
new file mode 100644
index 0000000000..edc63ba678
--- /dev/null
+++ b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/inventory/ChestMenu.java.patch
@@ -0,0 +1,45 @@
+--- a/net/minecraft/world/inventory/ChestMenu.java
++++ b/net/minecraft/world/inventory/ChestMenu.java
+@@ -5,16 +6,23 @@
+ import net.minecraft.world.entity.player.Inventory;
+ import net.minecraft.world.entity.player.Player;
+ import net.minecraft.world.item.ItemStack;
++import org.bukkit.craftbukkit.inventory.CraftInventory;
++import org.bukkit.craftbukkit.inventory.CraftInventoryView;
++// CraftBukkit end
+
+ public class ChestMenu extends AbstractContainerMenu {
+
+ private static final int SLOTS_PER_ROW = 9;
+ private final Container container;
+ private final int containerRows;
++ // CraftBukkit start
++ private CraftInventoryView bukkitEntity = null;
++ private Inventory player;
+
+ private ChestMenu(MenuType<?> menutype, int i, Inventory inventory, int j) {
+ this(menutype, i, inventory, new SimpleContainer(9 * j), j);
+ }
++ // CraftBukkit end
+
+ public static ChestMenu oneRow(int i, Inventory inventory) {
+ return new ChestMenu(MenuType.GENERIC_9x1, i, inventory, 1);
+@@ -56,6 +83,10 @@
+ container.startOpen(inventory.player);
+ int k = (this.containerRows - 4) * 18;
+
++ // CraftBukkit start - Save player
++ this.player = playerInventory;
++ // CraftBukkit end
++
+ int l;
+ int i1;
+
+@@ -80,6 +110,7 @@
+ @Override
+ @Override
+ public boolean stillValid(Player player) {
++ if (!this.checkReachable) return true; // CraftBukkit
+ return this.container.stillValid(player);
+ }
+