From 2477ec8f818f3521228fd232f3784e1637d47edb Mon Sep 17 00:00:00 2001 From: Jascha Starke Date: Sat, 26 Oct 2013 14:49:26 +0200 Subject: [PATCH] Workaround PlayerInteract with Air Event Bukkit-issue (eye of ender, etc.) --- .../minecraft/limitedcreative/limits/PlayerListener.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/jaschastarke/minecraft/limitedcreative/limits/PlayerListener.java b/src/main/java/de/jaschastarke/minecraft/limitedcreative/limits/PlayerListener.java index 574e331..5f4628f 100644 --- a/src/main/java/de/jaschastarke/minecraft/limitedcreative/limits/PlayerListener.java +++ b/src/main/java/de/jaschastarke/minecraft/limitedcreative/limits/PlayerListener.java @@ -64,7 +64,7 @@ public class PlayerListener implements Listener { * @return The relevant "isCancelled" */ public static boolean isCancelled(PlayerInteractEvent event) { - return event.isCancelled() || (event.useInteractedBlock() == Event.Result.DENY && event.useItemInHand() == Event.Result.DENY); + return (event.useInteractedBlock() == Event.Result.DENY && event.useItemInHand() == Event.Result.DENY); } @EventHandler @@ -162,7 +162,7 @@ public class PlayerListener implements Listener { } } - @EventHandler(ignoreCancelled = true) + @EventHandler // Do not use ignoreCancelled here, as some AIR-Interacts are interpreted as isCancelled by default public void onPlayerInteract(PlayerInteractEvent event) { if (!isCancelled(event) && event.getPlayer().getGameMode() == GameMode.CREATIVE) { if (event.getItem() != null && mod.getConfig().getBlockUse().isListed(event.getItem())) {