Fix for player right-clicking in the air causing an NPE due to target block being null

This commit is contained in:
Brettflan 2011-03-09 18:21:17 -06:00
parent 5ab5ef6724
commit 2ca8e4b9af

View File

@ -153,6 +153,9 @@ public class FactionsPlayerListener extends PlayerListener{
if (event.isCancelled())
return;
if (event.getBlockClicked() == null)
return; // right-clicked on air, not a block; no worries then
if (!this.playerCanUseItemHere(event.getPlayer(), event.getBlockClicked(), event.getItem().getTypeId()))
{
event.setCancelled(true);