Set ignoreCancelled flag to chest protection events

This commit is contained in:
Eric 2016-11-23 17:08:46 +01:00
parent eda52af179
commit cda28be3e3

View File

@ -44,7 +44,7 @@ public class ChestProtectListener implements Listener {
this.worldGuard = worldGuard; this.worldGuard = worldGuard;
} }
@EventHandler @EventHandler(ignoreCancelled = true)
public void onBlockBreak(BlockBreakEvent e) { public void onBlockBreak(BlockBreakEvent e) {
final Block b = e.getBlock(); final Block b = e.getBlock();
@ -94,7 +94,7 @@ public class ChestProtectListener implements Listener {
} }
} }
@EventHandler @EventHandler(ignoreCancelled = true)
public void onEntityExplode(EntityExplodeEvent e) { public void onEntityExplode(EntityExplodeEvent e) {
if (plugin.getShopChestConfig().explosion_protection) { if (plugin.getShopChestConfig().explosion_protection) {
ArrayList<Block> bl = new ArrayList<>(e.blockList()); ArrayList<Block> bl = new ArrayList<>(e.blockList());
@ -106,7 +106,7 @@ public class ChestProtectListener implements Listener {
} }
} }
@EventHandler @EventHandler(ignoreCancelled = true)
public void onBlockPlace(BlockPlaceEvent e) { public void onBlockPlace(BlockPlaceEvent e) {
Player p = e.getPlayer(); Player p = e.getPlayer();
Block b = e.getBlockPlaced(); Block b = e.getBlockPlaced();
@ -174,7 +174,7 @@ public class ChestProtectListener implements Listener {
} }
} }
@EventHandler(priority = EventPriority.HIGH) @EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
public void onItemMove(InventoryMoveItemEvent e) { public void onItemMove(InventoryMoveItemEvent e) {
if (plugin.getShopChestConfig().hopper_protection) { if (plugin.getShopChestConfig().hopper_protection) {
if ((e.getSource().getType().equals(InventoryType.CHEST)) && (!e.getInitiator().getType().equals(InventoryType.PLAYER))) { if ((e.getSource().getType().equals(InventoryType.CHEST)) && (!e.getInitiator().getType().equals(InventoryType.PLAYER))) {