From ade3c6b32015bb0c8af58ac366cd112243a3c4fb Mon Sep 17 00:00:00 2001 From: Brettflan Date: Tue, 6 Nov 2012 15:01:34 -0600 Subject: [PATCH] Fix for crop trampling and pressure plates not being protected due to bug introduced in recent performance overhaul --- .../factions/listeners/FactionsPlayerListener.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/com/massivecraft/factions/listeners/FactionsPlayerListener.java b/src/com/massivecraft/factions/listeners/FactionsPlayerListener.java index 7437c215..19289879 100644 --- a/src/com/massivecraft/factions/listeners/FactionsPlayerListener.java +++ b/src/com/massivecraft/factions/listeners/FactionsPlayerListener.java @@ -222,7 +222,8 @@ public class FactionsPlayerListener implements Listener public void onPlayerInteract(PlayerInteractEvent event) { if (event.isCancelled()) return; - if (event.getAction() != Action.RIGHT_CLICK_BLOCK) return; // only interested in right-clicks as of MC 1.4+; good performance boost + // only need to check right-clicks and physical as of MC 1.4+; good performance boost + if (event.getAction() != Action.RIGHT_CLICK_BLOCK && event.getAction() != Action.PHYSICAL) return; Block block = event.getClickedBlock(); Player player = event.getPlayer(); @@ -252,6 +253,8 @@ public class FactionsPlayerListener implements Listener return; } + if (event.getAction() != Action.RIGHT_CLICK_BLOCK) return; // only interested on right-clicks for below + if ( ! playerCanUseItemHere(player, block.getLocation(), event.getMaterial(), false)) { event.setCancelled(true);