Skip to content

Commit

Permalink
Fix tank modifier having different NBT when never filled vs emptied (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
KnightMiner committed Apr 27, 2023
1 parent 978e573 commit 0ef133d
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,10 @@ public FluidStack getFluid(IToolStackView tool) {

/** Sets the fluid in the tank */
public FluidStack setFluid(IToolStackView tool, FluidStack fluid) {
if (fluid.isEmpty()) {
tool.getPersistentData().remove(getFluidKey());
return fluid;
}
int capacity = getCapacity(tool);
if (fluid.getAmount() > capacity) {
fluid.setAmount(capacity);
Expand Down

0 comments on commit 0ef133d

Please sign in to comment.