Break denied hoppers.

This commit is contained in:
sk89q 2014-08-24 15:40:00 -07:00
parent 6da8fabb1f
commit 913d5d64ae

View File

@ -46,6 +46,7 @@
import org.bukkit.block.BlockFace;
import org.bukkit.block.BlockState;
import org.bukkit.block.DoubleChest;
import org.bukkit.block.Hopper;
import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.FallingBlock;
@ -630,7 +631,11 @@ public void onInventoryMoveItem(InventoryMoveItemEvent event) {
handleInventoryHolderUse(event, cause, targetHolder);
entry.setCancelled(event.isCancelled());
if (event.isCancelled() && causeHolder instanceof Hopper) {
((Hopper) causeHolder).getBlock().breakNaturally();
} else {
entry.setCancelled(event.isCancelled());
}
}
}