Fix for NPE when right/left clicking air.

This commit is contained in:
GJ 2013-02-22 13:59:07 -05:00
parent 9282b7bd15
commit e556b707c9

View File

@ -327,7 +327,12 @@ public class PlayerListener implements Listener {
} }
Block block = event.getClickedBlock(); Block block = event.getClickedBlock();
BlockState blockState = block.getState(); BlockState blockState = null;
if (block != null) {
blockState = block.getState();
}
ItemStack heldItem = player.getItemInHand(); ItemStack heldItem = player.getItemInHand();
switch (event.getAction()) { switch (event.getAction()) {