aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-spigotflower-stripped/net/minecraft/world/inventory/ShulkerBoxMenu.java.patch
blob: 6f85526956019cf4fbd371f2ac6274a357c15b56 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
--- a/net/minecraft/world/inventory/ShulkerBoxMenu.java
+++ b/net/minecraft/world/inventory/ShulkerBoxMenu.java
@@ -6,20 +6,30 @@
 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;
 
     public ShulkerBoxMenu(int i, Inventory inventory) {
         this(i, inventory, new SimpleContainer(27));
     }
+    // CraftBukkit end
 
     public ShulkerBoxMenu(int i, Inventory inventory, Container container) {
         super(MenuType.SHULKER_BOX, i);
         checkContainerSize(container, 27);
         this.container = container;
-        container.startOpen(inventory.player);
+        this.player = playerInventory; // CraftBukkit - save player
+        container.startOpen(playerInventory.player);
         boolean flag = true;
         boolean flag1 = true;
 
@@ -47,6 +66,7 @@
     @Override
     @Override
     public boolean stillValid(Player player) {
+        if (!this.checkReachable) return true; // CraftBukkit
         return this.container.stillValid(player);
     }