mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-12-25 18:47:44 +01:00
Break denied hoppers.
This commit is contained in:
parent
6da8fabb1f
commit
913d5d64ae
@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user