2015-05-25 12:37:24 +02:00
|
|
|
--- a/net/minecraft/server/ContainerAnvil.java
|
|
|
|
+++ b/net/minecraft/server/ContainerAnvil.java
|
2014-11-25 22:32:16 +01:00
|
|
|
@@ -6,6 +6,8 @@
|
|
|
|
import org.apache.logging.log4j.LogManager;
|
|
|
|
import org.apache.logging.log4j.Logger;
|
|
|
|
|
|
|
|
+import org.bukkit.craftbukkit.inventory.CraftInventoryView; // CraftBukkit
|
|
|
|
+
|
|
|
|
public class ContainerAnvil extends Container {
|
|
|
|
|
|
|
|
private static final Logger f = LogManager.getLogger();
|
2015-02-26 23:41:06 +01:00
|
|
|
@@ -22,8 +24,13 @@
|
2014-11-25 22:32:16 +01:00
|
|
|
private int k;
|
|
|
|
private String l;
|
|
|
|
private final EntityHuman m;
|
|
|
|
+ // CraftBukkit start
|
|
|
|
+ private CraftInventoryView bukkitEntity = null;
|
|
|
|
+ private PlayerInventory player;
|
2015-02-26 23:41:06 +01:00
|
|
|
+ // CraftBukkit end
|
2014-11-25 22:32:16 +01:00
|
|
|
|
2015-02-26 23:41:06 +01:00
|
|
|
public ContainerAnvil(PlayerInventory playerinventory, final World world, final BlockPosition blockposition, EntityHuman entityhuman) {
|
2014-11-25 22:32:16 +01:00
|
|
|
+ this.player = playerinventory; // CraftBukkit
|
|
|
|
this.j = blockposition;
|
|
|
|
this.i = world;
|
|
|
|
this.m = entityhuman;
|
2015-02-26 23:41:06 +01:00
|
|
|
@@ -317,6 +324,7 @@
|
2014-11-25 22:32:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public boolean a(EntityHuman entityhuman) {
|
|
|
|
+ if (!this.checkReachable) return true; // CraftBukkit
|
|
|
|
return this.i.getType(this.j).getBlock() != Blocks.ANVIL ? false : entityhuman.e((double) this.j.getX() + 0.5D, (double) this.j.getY() + 0.5D, (double) this.j.getZ() + 0.5D) <= 64.0D;
|
|
|
|
}
|
|
|
|
|
2015-02-26 23:41:06 +01:00
|
|
|
@@ -372,4 +380,17 @@
|
|
|
|
|
|
|
|
this.e();
|
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;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ org.bukkit.craftbukkit.inventory.CraftInventory inventory = new org.bukkit.craftbukkit.inventory.CraftInventoryAnvil(this.h, this.g);
|
|
|
|
+ bukkitEntity = new CraftInventoryView(this.player.player.getBukkitEntity(), inventory, this);
|
|
|
|
+ return bukkitEntity;
|
|
|
|
+ }
|
|
|
|
+ // CraftBukkit end
|
|
|
|
}
|