Performance improvement for player interact events.

Now ignoring all "left click on air" events.
This commit is contained in:
ryanhamshire 2014-10-20 14:40:02 -07:00
parent a15e5ce68e
commit 6311bf86ee

View File

@ -1029,6 +1029,10 @@ class PlayerEventHandler implements Listener
Player player = event.getPlayer(); Player player = event.getPlayer();
Block clickedBlock = event.getClickedBlock(); //null returned here means interacting with air Block clickedBlock = event.getClickedBlock(); //null returned here means interacting with air
Action action = event.getAction(); Action action = event.getAction();
//not interested in left-click-on-air actions
if(action == Action.LEFT_CLICK_AIR) return;
Material clickedBlockType = null; Material clickedBlockType = null;
if(clickedBlock != null) if(clickedBlock != null)
{ {