ignoreCancelled via annotation

This commit is contained in:
Jascha Starke 2013-09-24 17:47:02 +02:00
parent 775ef40b1a
commit 7506a7f1c1

View file

@ -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);