From e267d0110d53aa538b1012bb2ddd1cf7aec24429 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Fri, 29 Apr 2016 19:31:33 +0200 Subject: [PATCH] Fixed a bug causing the player to be unable to fill buckets --- .../actuallyadditions/mod/event/BucketFillEvent.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/event/BucketFillEvent.java b/src/main/java/de/ellpeck/actuallyadditions/mod/event/BucketFillEvent.java index 1aa29f8a1..d3bd5b97a 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/event/BucketFillEvent.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/event/BucketFillEvent.java @@ -30,11 +30,13 @@ public class BucketFillEvent{ } private void fillBucket(FillBucketEvent event, Item item, Block fluid){ - Block block = PosUtil.getBlock(event.getTarget().getBlockPos(), event.getWorld()); - if(block == fluid){ - event.getWorld().setBlockToAir(event.getTarget().getBlockPos()); - event.setFilledBucket(new ItemStack(item)); - event.setResult(Event.Result.ALLOW); + if(event.getTarget() != null && event.getTarget().getBlockPos() != null){ + Block block = PosUtil.getBlock(event.getTarget().getBlockPos(), event.getWorld()); + if(block == fluid){ + event.getWorld().setBlockToAir(event.getTarget().getBlockPos()); + event.setFilledBucket(new ItemStack(item)); + event.setResult(Event.Result.ALLOW); + } } } }