2015-05-25 12:37:24 +02:00
--- a/net/minecraft/server/ContainerBeacon.java
+++ b/net/minecraft/server/ContainerBeacon.java
2016-05-10 13:47:39 +02:00
@@ -1,13 +1,19 @@
2014-11-25 22:32:16 +01:00
package net.minecraft.server;
2016-05-10 13:47:39 +02:00
import javax.annotation.Nullable;
2014-11-25 22:32:16 +01:00
+import org.bukkit.craftbukkit.inventory.CraftInventoryView; // CraftBukkit
2016-05-10 13:47:39 +02:00
2014-11-25 22:32:16 +01:00
public class ContainerBeacon extends Container {
2016-06-09 03:43:49 +02:00
private final IInventory beacon;
2015-02-26 23:41:06 +01:00
private final ContainerBeacon.SlotBeacon f;
2014-11-25 22:32:16 +01:00
+ // CraftBukkit start
+ private CraftInventoryView bukkitEntity = null;
+ private PlayerInventory player;
+ // CraftBukkit end
public ContainerBeacon(IInventory iinventory, IInventory iinventory1) {
+ player = (PlayerInventory) iinventory; // CraftBukkit - TODO: check this
2015-07-30 08:56:52 +02:00
this.beacon = iinventory1;
2016-06-09 03:43:49 +02:00
this.f = new ContainerBeacon.SlotBeacon(iinventory1, 0, 136, 110);
this.a((Slot) this.f);
@@ -50,6 +56,7 @@
2014-11-25 22:32:16 +01:00
}
public boolean a(EntityHuman entityhuman) {
+ if (!this.checkReachable) return true; // CraftBukkit
2015-07-30 08:56:52 +02:00
return this.beacon.a(entityhuman);
2014-11-25 22:32:16 +01:00
}
2016-06-09 03:43:49 +02:00
@@ -114,4 +121,17 @@
2015-02-26 23:41:06 +01:00
return 1;
}
2014-11-25 22:32:16 +01:00
}
2015-02-26 23:41:06 +01:00
+
2014-11-25 22:32:16 +01:00
+ // CraftBukkit start
+ @Override
+ public CraftInventoryView getBukkitView() {
+ if (bukkitEntity != null) {
+ return bukkitEntity;
+ }
+
2015-07-30 08:56:52 +02:00
+ org.bukkit.craftbukkit.inventory.CraftInventory inventory = new org.bukkit.craftbukkit.inventory.CraftInventoryBeacon((TileEntityBeacon) this.beacon); // TODO - check this
2014-11-25 22:32:16 +01:00
+ bukkitEntity = new CraftInventoryView(this.player.player.getBukkitEntity(), inventory, this);
+ return bukkitEntity;
+ }
+ // CraftBukkit end
}