diff options
Diffstat (limited to 'nms-patches/TileEntityHopper.patch')
-rw-r--r-- | nms-patches/TileEntityHopper.patch | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/nms-patches/TileEntityHopper.patch b/nms-patches/TileEntityHopper.patch index e3ed30c2..9e6e3a18 100644 --- a/nms-patches/TileEntityHopper.patch +++ b/nms-patches/TileEntityHopper.patch @@ -13,7 +13,7 @@ +import org.bukkit.inventory.Inventory; +// CraftBukkit end + - public class TileEntityHopper extends TileEntityContainer implements IHopper, IUpdatePlayerListBox { + public class TileEntityHopper extends TileEntityLootable implements IHopper, ITickable { private ItemStack[] items = new ItemStack[5]; private String f; @@ -47,7 +47,7 @@ public TileEntityHopper() {} public void a(NBTTagCompound nbttagcompound) { -@@ -120,7 +154,7 @@ +@@ -100,7 +134,7 @@ } public int getMaxStackSize() { @@ -56,7 +56,7 @@ } public boolean a(EntityHuman entityhuman) { -@@ -216,10 +250,35 @@ +@@ -196,10 +230,35 @@ for (int i = 0; i < this.getSize(); ++i) { if (this.getItem(i) != null) { ItemStack itemstack = this.getItem(i).cloneItemStack(); @@ -78,7 +78,7 @@ + this.getWorld().getServer().getPluginManager().callEvent(event); + if (event.isCancelled()) { + this.setItem(i, itemstack); -+ this.d(8); // Delay hopper checks ++ this.setCooldown(8); // Delay hopper checks + return false; + } + ItemStack itemstack1 = addItem(iinventory, CraftItemStack.asNMSCopy(event.getItem()), enumdirection); @@ -94,7 +94,7 @@ return true; } -@@ -330,10 +389,41 @@ +@@ -310,10 +369,41 @@ if (itemstack != null && b(iinventory, itemstack, i, enumdirection)) { ItemStack itemstack1 = itemstack.cloneItemStack(); @@ -118,9 +118,9 @@ + iinventory.setItem(i, itemstack1); + + if (ihopper instanceof TileEntityHopper) { -+ ((TileEntityHopper) ihopper).d(8); // Delay hopper checks ++ ((TileEntityHopper) ihopper).setCooldown(8); // Delay hopper checks + } else if (ihopper instanceof EntityMinecartHopper) { -+ ((EntityMinecartHopper) ihopper).m(4); // Delay hopper minecart checks ++ ((EntityMinecartHopper) ihopper).setCooldown(4); // Delay hopper minecart checks + } + + return false; @@ -138,7 +138,7 @@ return true; } -@@ -349,6 +439,13 @@ +@@ -329,6 +419,13 @@ if (entityitem == null) { return false; } else { |