From 7506a7f1c16a024dc0e461d4aca6b44d5be5d917 Mon Sep 17 00:00:00 2001 From: Jascha Starke Date: Tue, 24 Sep 2013 17:47:02 +0200 Subject: [PATCH] ignoreCancelled via annotation --- .../minecraft/limitedcreative/limits/BlockListener.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/de/jaschastarke/minecraft/limitedcreative/limits/BlockListener.java b/src/main/java/de/jaschastarke/minecraft/limitedcreative/limits/BlockListener.java index 77e4d74..0e44571 100644 --- a/src/main/java/de/jaschastarke/minecraft/limitedcreative/limits/BlockListener.java +++ b/src/main/java/de/jaschastarke/minecraft/limitedcreative/limits/BlockListener.java @@ -35,9 +35,9 @@ public class BlockListener implements Listener { this.mod = mod; } - @EventHandler + @EventHandler(ignoreCancelled = true) public void onBlockBreak(BlockBreakEvent event) { - if (!event.isCancelled() && event.getPlayer().getGameMode() == GameMode.CREATIVE) { + if (event.getPlayer().getGameMode() == GameMode.CREATIVE) { if (mod.getConfig().getBlockBreak().isListed(event.getBlock())) { if (!checkPermission(event.getPlayer(), NoLimitPermissions.BREAK(event.getBlock()))) { event.setCancelled(true); @@ -46,9 +46,9 @@ public class BlockListener implements Listener { } } } - @EventHandler + @EventHandler(ignoreCancelled = true) public void onBlockPlace(BlockPlaceEvent event) { - if (!event.isCancelled() && event.getPlayer().getGameMode() == GameMode.CREATIVE) { + if (event.getPlayer().getGameMode() == GameMode.CREATIVE) { if (mod.getConfig().getBlockUse().isListed(event.getBlock())) { if (!checkPermission(event.getPlayer(), NoLimitPermissions.USE(event.getBlock()))) { event.setCancelled(true);