Paper/nms-patches/ContainerBeacon.patch
2015-03-04 09:48:58 +00:00

48 lines
1.6 KiB
Diff

--- /home/matt/mc-dev-private//net/minecraft/server/ContainerBeacon.java 2015-02-26 22:40:22.379608142 +0000
+++ src/main/java/net/minecraft/server/ContainerBeacon.java 2015-02-26 22:40:22.379608142 +0000
@@ -1,11 +1,18 @@
package net.minecraft.server;
+import org.bukkit.craftbukkit.inventory.CraftInventoryView; // CraftBukkit
+
public class ContainerBeacon extends Container {
private IInventory a;
private final ContainerBeacon.SlotBeacon f;
+ // CraftBukkit start
+ private CraftInventoryView bukkitEntity = null;
+ private PlayerInventory player;
+ // CraftBukkit end
public ContainerBeacon(IInventory iinventory, IInventory iinventory1) {
+ player = (PlayerInventory) iinventory; // CraftBukkit - TODO: check this
this.a = iinventory1;
this.a((Slot) (this.f = new ContainerBeacon.SlotBeacon(iinventory1, 0, 136, 110)));
byte b0 = 36;
@@ -47,6 +54,7 @@
}
public boolean a(EntityHuman entityhuman) {
+ if (!this.checkReachable) return true; // CraftBukkit
return this.a.a(entityhuman);
}
@@ -110,4 +118,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((TileEntityBeacon) this.a); // TODO - check this
+ bukkitEntity = new CraftInventoryView(this.player.player.getBukkitEntity(), inventory, this);
+ return bukkitEntity;
+ }
+ // CraftBukkit end
}