aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-vineflower-stripped/net/minecraft/world/inventory/ShulkerBoxMenu.java.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/mache-vineflower-stripped/net/minecraft/world/inventory/ShulkerBoxMenu.java.patch')
-rw-r--r--patch-remap/mache-vineflower-stripped/net/minecraft/world/inventory/ShulkerBoxMenu.java.patch48
1 files changed, 48 insertions, 0 deletions
diff --git a/patch-remap/mache-vineflower-stripped/net/minecraft/world/inventory/ShulkerBoxMenu.java.patch b/patch-remap/mache-vineflower-stripped/net/minecraft/world/inventory/ShulkerBoxMenu.java.patch
new file mode 100644
index 0000000000..256b91aa07
--- /dev/null
+++ b/patch-remap/mache-vineflower-stripped/net/minecraft/world/inventory/ShulkerBoxMenu.java.patch
@@ -0,0 +1,48 @@
+--- a/net/minecraft/world/inventory/ShulkerBoxMenu.java
++++ b/net/minecraft/world/inventory/ShulkerBoxMenu.java
+@@ -6,10 +6,29 @@
+ import net.minecraft.world.entity.player.Player;
+ import net.minecraft.world.item.ItemStack;
+
++// CraftBukkit start
++import org.bukkit.craftbukkit.inventory.CraftInventory;
++import org.bukkit.craftbukkit.inventory.CraftInventoryView;
++// CraftBukkit end
++
+ public class ShulkerBoxMenu extends AbstractContainerMenu {
+ private static final int CONTAINER_SIZE = 27;
+ private final Container container;
++ // CraftBukkit start
++ private CraftInventoryView bukkitEntity;
++ private Inventory player;
+
++ @Override
++ public CraftInventoryView getBukkitView() {
++ if (bukkitEntity != null) {
++ return bukkitEntity;
++ }
++
++ bukkitEntity = new CraftInventoryView(this.player.player.getBukkitEntity(), new CraftInventory(this.container), this);
++ return bukkitEntity;
++ }
++ // CraftBukkit end
++
+ public ShulkerBoxMenu(int containerId, Inventory playerInventory) {
+ this(containerId, playerInventory, new SimpleContainer(27));
+ }
+@@ -18,6 +38,7 @@
+ super(MenuType.SHULKER_BOX, containerId);
+ checkContainerSize(container, 27);
+ this.container = container;
++ this.player = playerInventory; // CraftBukkit - save player
+ container.startOpen(playerInventory.player);
+ int i = 3;
+ int i1 = 9;
+@@ -41,6 +66,7 @@
+
+ @Override
+ public boolean stillValid(Player player) {
++ if (!this.checkReachable) return true; // CraftBukkit
+ return this.container.stillValid(player);
+ }
+