mirror of
https://github.com/MassiveCraft/Factions.git
synced 2024-11-19 08:45:54 +01:00
Fix for crop trampling and pressure plates not being protected due to bug introduced in recent performance overhaul
This commit is contained in:
parent
c11d9b03a3
commit
ade3c6b320
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user