Skip to content

Commit

Permalink
Fix buckets disappearing when they can't completely fill flopper
Browse files Browse the repository at this point in the history
Closes #23
  • Loading branch information
rubensworks committed Oct 4, 2021
1 parent cae7d19 commit f71b7b1
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/main/java/org/cyclops/flopper/block/BlockFlopper.java
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,12 @@ public ActionResultType onBlockActivated(BlockState blockState, World world, Blo
if (!player.isCrouching()
&& tryEmptyContainer(itemStack, fluidHandler, FluidHelpers.BUCKET_VOLUME, player, false).isSuccess()) {
// Move fluid from the item into the tank if not sneaking
ItemStack drainedItem = FluidUtil.tryEmptyContainer(itemStack, fluidHandler, FluidHelpers.BUCKET_VOLUME, player, true).getResult();
if (!player.isCreative()) {
InventoryHelpers.tryReAddToStack(player, itemStack, drainedItem);
FluidActionResult result = FluidUtil.tryEmptyContainer(itemStack, fluidHandler, FluidHelpers.BUCKET_VOLUME, player, true);
if (result.isSuccess()) {
ItemStack drainedItem = result.getResult();
if (!player.isCreative()) {
InventoryHelpers.tryReAddToStack(player, itemStack, drainedItem);
}
}
return ActionResultType.SUCCESS;
} else if (player.isCrouching()
Expand Down

0 comments on commit f71b7b1

Please sign in to comment.