Catching right clicks instead of lefts

This commit is contained in:
SvenjaReißaus 2019-03-18 21:49:37 -05:00
parent 35b5724da5
commit 2437e206b7
No known key found for this signature in database
GPG Key ID: E5494A03FA36D54B
2 changed files with 1 additions and 1 deletions

View File

@ -862,7 +862,7 @@ public class FactionsPlayerListener implements Listener {
public void onPlayerInteract(PlayerInteractEvent event) { public void onPlayerInteract(PlayerInteractEvent event) {
// only need to check right-clicks and physical as of MC 1.4+; good performance boost // only need to check right-clicks and physical as of MC 1.4+; good performance boost
SavageFactions.plugin.log("Checking if the action aren't left clicks"); SavageFactions.plugin.log("Checking if the action aren't left clicks");
if (!event.getAction().equals(Action.LEFT_CLICK_BLOCK) || !event.getAction().equals(Action.LEFT_CLICK_AIR)) return; if (event.getAction().equals(Action.LEFT_CLICK_BLOCK) || event.getAction().equals(Action.LEFT_CLICK_AIR)) return;
SavageFactions.plugin.log("Attempting to allow food and potis"); SavageFactions.plugin.log("Attempting to allow food and potis");
if (event.getPlayer().getItemInHand() != null) { if (event.getPlayer().getItemInHand() != null) {
Material handItem = event.getPlayer().getItemInHand().getType(); Material handItem = event.getPlayer().getItemInHand().getType();