aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-spigotflower-stripped/net/minecraft/world/inventory/BeaconMenu.java.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/mache-spigotflower-stripped/net/minecraft/world/inventory/BeaconMenu.java.patch')
-rw-r--r--patch-remap/mache-spigotflower-stripped/net/minecraft/world/inventory/BeaconMenu.java.patch58
1 files changed, 58 insertions, 0 deletions
diff --git a/patch-remap/mache-spigotflower-stripped/net/minecraft/world/inventory/BeaconMenu.java.patch b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/inventory/BeaconMenu.java.patch
new file mode 100644
index 0000000000..8e5ec5d3c2
--- /dev/null
+++ b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/inventory/BeaconMenu.java.patch
@@ -0,0 +1,58 @@
+--- a/net/minecraft/world/inventory/BeaconMenu.java
++++ b/net/minecraft/world/inventory/BeaconMenu.java
+@@ -11,6 +12,8 @@
+ import net.minecraft.world.item.ItemStack;
+ import net.minecraft.world.level.Level;
+ import net.minecraft.world.level.block.Blocks;
++import org.bukkit.craftbukkit.inventory.CraftInventoryView;
++// CraftBukkit end
+
+ public class BeaconMenu extends AbstractContainerMenu {
+
+@@ -26,13 +29,18 @@
+ private final BeaconMenu.PaymentSlot paymentSlot;
+ private final ContainerLevelAccess access;
+ private final ContainerData beaconData;
++ // CraftBukkit start
++ private CraftInventoryView bukkitEntity = null;
++ private Inventory player;
++ // CraftBukkit end
+
+ public BeaconMenu(int i, Container container) {
+ this(i, container, new SimpleContainerData(3), ContainerLevelAccess.NULL);
+ }
+
+- public BeaconMenu(int i, Container container, ContainerData containerdata, ContainerLevelAccess containerlevelaccess) {
+- super(MenuType.BEACON, i);
++ public BeaconMenu(int containerId, Container container, ContainerData beaconData, ContainerLevelAccess access) {
++ super(MenuType.BEACON, containerId);
++ player = (Inventory) container; // CraftBukkit - TODO: check this
+ this.beacon = new SimpleContainer(1) {
+ @Override
+ @Override
+@@ -86,6 +90,7 @@
+ @Override
+ @Override
+ public boolean stillValid(Player player) {
++ if (!this.checkReachable) return true; // CraftBukkit
+ return stillValid(this.access, player, Blocks.BEACON);
+ }
+
+@@ -199,4 +200,17 @@
+ return 1;
+ }
+ }
++
++ // CraftBukkit start
++ @Override
++ public CraftInventoryView getBukkitView() {
++ if (bukkitEntity != null) {
++ return bukkitEntity;
++ }
++
++ org.bukkit.craftbukkit.inventory.CraftInventory inventory = new org.bukkit.craftbukkit.inventory.CraftInventoryBeacon(this.beacon);
++ bukkitEntity = new CraftInventoryView(this.player.player.getBukkitEntity(), inventory, this);
++ return bukkitEntity;
++ }
++ // CraftBukkit end
+ }