Fixed NPE when using an empty bucket
This commit is contained in:
parent
ad97710dda
commit
f9bf63ccf1
3 changed files with 28 additions and 0 deletions
|
@ -391,6 +391,11 @@ public class EventHandler
|
|||
|
||||
ItemStack result = null;
|
||||
|
||||
if (event.getTarget() == null || event.getTarget().getBlockPos() == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Block block = event.getWorld().getBlockState(event.getTarget().getBlockPos()).getBlock();
|
||||
|
||||
if (block != null && (block.equals(ModBlocks.lifeEssence)) && block.getMetaFromState(event.getWorld().getBlockState(event.getTarget().getBlockPos())) == 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue