mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-12-22 19:39:24 +01:00
Fixed a bug causing the player to be unable to fill buckets
This commit is contained in:
parent
3cd7512ed6
commit
e267d0110d
1 changed files with 7 additions and 5 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue