mirror of
https://github.com/PEXPlugins/Modifyworld.git
synced 2024-11-16 10:35:32 +01:00
Optimized itemRestriction call on block interaction. Now it would be called only on right click
This commit is contained in:
parent
72151423f8
commit
3510011f47
@ -178,10 +178,12 @@ public class PlayerListener extends ModifyworldListener {
|
||||
|
||||
@EventHandler(Type.PLAYER_INTERACT)
|
||||
public void onPlayerInteract(PlayerInteractEvent event) {
|
||||
// Checking item restriction
|
||||
this.checkPlayerInventory(event.getPlayer());
|
||||
|
||||
Action action = event.getAction();
|
||||
|
||||
if(action == Action.RIGHT_CLICK_AIR || action == Action.RIGHT_CLICK_BLOCK){ // item restriction check
|
||||
this.checkPlayerInventory(event.getPlayer());
|
||||
}
|
||||
|
||||
if (action != Action.LEFT_CLICK_BLOCK && action != Action.RIGHT_CLICK_BLOCK && action != Action.PHYSICAL) {
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user