From 2f80787edd3fe392736f0d91612fa5a1a619ca1f Mon Sep 17 00:00:00 2001 From: Brettflan Date: Tue, 6 Nov 2012 15:01:37 -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 fd0c109a..ef580593 100644 --- a/src/com/massivecraft/factions/listeners/FactionsPlayerListener.java +++ b/src/com/massivecraft/factions/listeners/FactionsPlayerListener.java @@ -136,7 +136,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(); @@ -166,6 +167,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);