Performance improvement for player interact events.
Now ignoring all "left click on air" events.
This commit is contained in:
parent
a15e5ce68e
commit
6311bf86ee
|
|
@ -1029,6 +1029,10 @@ class PlayerEventHandler implements Listener
|
|||
Player player = event.getPlayer();
|
||||
Block clickedBlock = event.getClickedBlock(); //null returned here means interacting with air
|
||||
Action action = event.getAction();
|
||||
|
||||
//not interested in left-click-on-air actions
|
||||
if(action == Action.LEFT_CLICK_AIR) return;
|
||||
|
||||
Material clickedBlockType = null;
|
||||
if(clickedBlock != null)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user