From b5320429731b10a48d4d9892a5f73c533144cb57 Mon Sep 17 00:00:00 2001 From: Travis Watkins Date: Sun, 24 Mar 2013 12:38:57 -0500 Subject: [PATCH] Don't assume all hoppers are blocks. Fixes BUKKIT-3883 --- src/main/java/net/minecraft/server/TileEntityHopper.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/minecraft/server/TileEntityHopper.java b/src/main/java/net/minecraft/server/TileEntityHopper.java index 8e0918d666..94c510f836 100644 --- a/src/main/java/net/minecraft/server/TileEntityHopper.java +++ b/src/main/java/net/minecraft/server/TileEntityHopper.java @@ -282,7 +282,13 @@ public class TileEntityHopper extends TileEntity implements IHopper { ihopper.getWorld().getServer().getPluginManager().callEvent(event); if (event.isCancelled()) { iinventory.setItem(i, itemstack1); - ((TileEntityHopper) ihopper).c(8); // delay hopper checks + + if (ihopper instanceof TileEntityHopper) { + ((TileEntityHopper) ihopper).c(8); // delay hopper checks + } else if (ihopper instanceof EntityMinecartHopper) { + ((EntityMinecartHopper) ihopper).n(4); // delay hopper minecart checks + } + return false; } ItemStack itemstack2 = addItem(ihopper, CraftItemStack.asNMSCopy(event.getItem()), -1); @@ -294,6 +300,7 @@ public class TileEntityHopper extends TileEntity implements IHopper { iinventory.setItem(i, itemstack1); } // CraftBukkit end + return true; }