mirror of
https://github.com/Flowsqy/ShopChest.git
synced 2024-12-24 05:27:37 +01:00
fix pistons removing shulker shops
This commit is contained in:
parent
9a1eda96b2
commit
7f33895986
@ -12,6 +12,9 @@ import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.block.BlockBreakEvent;
|
||||
import org.bukkit.event.block.BlockPistonEvent;
|
||||
import org.bukkit.event.block.BlockPistonExtendEvent;
|
||||
import org.bukkit.event.block.BlockPistonRetractEvent;
|
||||
import org.bukkit.event.block.BlockPlaceEvent;
|
||||
import org.bukkit.event.entity.EntityExplodeEvent;
|
||||
import org.bukkit.event.inventory.InventoryMoveItemEvent;
|
||||
@ -126,6 +129,28 @@ public class ChestProtectListener implements Listener {
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(ignoreCancelled = true)
|
||||
public void onPistonExtend(BlockPistonExtendEvent e) {
|
||||
for (Block b: e.getBlocks()) {
|
||||
if (ShopUtils.isShopMaterial(b.getType())) {
|
||||
if (shopUtils.isShop(b.getLocation())) {
|
||||
e.setCancelled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(ignoreCancelled = true)
|
||||
public void onPistonRetract(BlockPistonRetractEvent e) {
|
||||
for (Block b: e.getBlocks()) {
|
||||
if (ShopUtils.isShopMaterial(b.getType())) {
|
||||
if (shopUtils.isShop(b.getLocation())) {
|
||||
e.setCancelled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(ignoreCancelled = true)
|
||||
public void onBlockPlace(BlockPlaceEvent e) {
|
||||
final Player p = e.getPlayer();
|
||||
|
Loading…
Reference in New Issue
Block a user