Fixed a crash with buckets. Closes #713

This commit is contained in:
Adubbz 2016-03-19 20:34:33 +11:00
parent 8cf988e9aa
commit d2203a780a

View file

@ -33,7 +33,7 @@ public class BucketEventHandler
{
// check we're using a bucket, on a block we can modify
if (event.getEmptyBucket().getItem() != Items.bucket) {return;}
if (event.getTarget().typeOfHit != RayTraceResult.Type.BLOCK) {return;}
if (event.getTarget() == null || event.getTarget().typeOfHit != RayTraceResult.Type.BLOCK) {return;}
BlockPos blockpos = event.getTarget().getBlockPos();
if (!event.getWorld().isBlockModifiable(event.entityPlayer, blockpos)) {return;}
if (!event.entityPlayer.canPlayerEdit(blockpos.offset(event.getTarget().sideHit), event.getTarget().sideHit, event.getEmptyBucket())) {return;}