diff --git a/src/de/epiceric/shopchest/listeners/ItemProtectListener.java b/src/de/epiceric/shopchest/listeners/ItemProtectListener.java index 3267d92..e50f8ab 100644 --- a/src/de/epiceric/shopchest/listeners/ItemProtectListener.java +++ b/src/de/epiceric/shopchest/listeners/ItemProtectListener.java @@ -9,13 +9,11 @@ import org.bukkit.entity.Item; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; -import org.bukkit.event.block.BlockMultiPlaceEvent; -import org.bukkit.event.block.BlockPistonExtendEvent; -import org.bukkit.event.block.BlockPistonRetractEvent; -import org.bukkit.event.block.BlockPlaceEvent; +import org.bukkit.event.block.*; import org.bukkit.event.entity.ItemDespawnEvent; import org.bukkit.event.inventory.InventoryPickupItemEvent; import org.bukkit.event.inventory.InventoryType; +import org.bukkit.event.player.PlayerBucketEmptyEvent; import org.bukkit.event.player.PlayerPickupItemEvent; public class ItemProtectListener implements Listener { @@ -80,4 +78,19 @@ public class ItemProtectListener implements Listener { } } + @EventHandler(priority = EventPriority.HIGH) + public void onLiquidFlow(BlockFromToEvent e) { + Block b = e.getToBlock(); + Block below = b.getRelative(BlockFace.DOWN); + + if (ShopUtils.isShop(below.getLocation())) e.setCancelled(true); + } + + @EventHandler(priority = EventPriority.HIGH) + public void onBucketEmpty(PlayerBucketEmptyEvent e) { + Block b = e.getBlockClicked(); + + if (ShopUtils.isShop(b.getLocation())) e.setCancelled(true); + } + }