mirror of
https://github.com/EpicEricEE/ShopChest.git
synced 2024-11-27 04:55:34 +01:00
Prevent liquids from washing shop items away
This commit is contained in:
parent
582cc76c83
commit
8b736da181
@ -9,13 +9,11 @@ import org.bukkit.entity.Item;
|
|||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.EventPriority;
|
import org.bukkit.event.EventPriority;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.event.block.BlockMultiPlaceEvent;
|
import org.bukkit.event.block.*;
|
||||||
import org.bukkit.event.block.BlockPistonExtendEvent;
|
|
||||||
import org.bukkit.event.block.BlockPistonRetractEvent;
|
|
||||||
import org.bukkit.event.block.BlockPlaceEvent;
|
|
||||||
import org.bukkit.event.entity.ItemDespawnEvent;
|
import org.bukkit.event.entity.ItemDespawnEvent;
|
||||||
import org.bukkit.event.inventory.InventoryPickupItemEvent;
|
import org.bukkit.event.inventory.InventoryPickupItemEvent;
|
||||||
import org.bukkit.event.inventory.InventoryType;
|
import org.bukkit.event.inventory.InventoryType;
|
||||||
|
import org.bukkit.event.player.PlayerBucketEmptyEvent;
|
||||||
import org.bukkit.event.player.PlayerPickupItemEvent;
|
import org.bukkit.event.player.PlayerPickupItemEvent;
|
||||||
|
|
||||||
public class ItemProtectListener implements Listener {
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user