Fix math when cell restricted and new fluid added (#284)

Co-authored-by: Maya <10861407+serenibyss@users.noreply.github.com>
This commit is contained in:
lordIcocainandMaya authored and GitHub committed 2025-04-21 05:51:46 +00:00
1 parent d222b00de2
commit 56703bf498
1 file changed
+4 -2
@@ -397,8 +397,10 @@ public class FluidCellInventory implements IFluidCellInventory {
if (cardDistribution) {
remainingFluidCount = this.getRemainingFluidCountDist(null);
} else {
remainingFluidCount = this.getRemainingFluidCount()
- ((long) this.getBytesPerType() * singleByteAmount);
remainingFluidCount = Math.min(
getRemainingFluidCount(),
getFreeBytes() * singleByteAmount + getUnusedFluidCount()
- (long) getBytesPerType() * singleByteAmount);
}
if (remainingFluidCount > 0) {