Skip to content

Commit

Permalink
feat: Add isEmpty and setAmount to Fluidtank
Browse files Browse the repository at this point in the history
  • Loading branch information
BlayTheNinth committed Feb 28, 2024
1 parent db78b91 commit 10514d9
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ public int getAmount() {
return amount;
}

public void setAmount(int amount) {
this.amount = amount;
}

public int getCapacity() {
return capacity;
}
Expand All @@ -88,6 +92,10 @@ public boolean canFill(Fluid fluid) {
return (this.fluid.isSame(fluid) || this.fluid.isSame(Fluids.EMPTY)) && maxFill > 0;
}

public boolean isEmpty() {
return amount <= 0 || fluid.isSame(Fluids.EMPTY);
}

public CompoundTag serialize() {
CompoundTag tag = new CompoundTag();
tag.putString("Fluid", Balm.getRegistries().getKey(fluid).toString());
Expand Down

0 comments on commit 10514d9

Please sign in to comment.