Skip to content

Commit

Permalink
coyple more fluid stack copies
Browse files Browse the repository at this point in the history
  • Loading branch information
thiakil committed Jan 26, 2025
1 parent 827aa43 commit 3d23e21
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ public ItemSlotsBuilder addFluidDrainSlot(int tankIndex) {
if (fluidInTank.isEmpty()) {
return FluidInventorySlot.isNonFullFluidContainer(itemFluidHandler);
}
return itemFluidHandler.fill(fluidInTank, FluidAction.SIMULATE) > 0;
return itemFluidHandler.fill(fluidInTank.copy(), FluidAction.SIMULATE) > 0;
}
return false;
}, BasicInventorySlot.alwaysTrue)));
Expand Down Expand Up @@ -313,6 +313,8 @@ public ItemSlotsBuilder addFluidInputSlot(int tankIndex) {
if (fluid.getAmount() < FluidType.BUCKET_VOLUME) {
//Workaround for buckets not being able to be filled until we have enough of our volume
fluid = fluid.copyWithAmount(FluidType.BUCKET_VOLUME);
} else {
fluid = fluid.copy();//avoid handler modifying
}
return fluidHandlerItem.fill(fluid, FluidAction.SIMULATE) > 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ protected static Predicate<ItemStack> getInputPredicate(IExtendedFluidTank fluid
if (fluid.getAmount() < FluidType.BUCKET_VOLUME) {
//Workaround for buckets not being able to be filled until we have enough of our volume
fluid = fluid.copyWithAmount(FluidType.BUCKET_VOLUME);
} else {
fluid = fluid.copy();//avoid handler modifying
}
return fluidHandlerItem.fill(fluid, FluidAction.SIMULATE) > 0;
}
Expand Down

0 comments on commit 3d23e21

Please sign in to comment.