From 7663cfcc2fc6a0c9138af2dd50f23b128bbc8277 Mon Sep 17 00:00:00 2001 From: lc_1337 Date: Tue, 11 Nov 2025 10:25:19 +0200 Subject: [PATCH] fix cell restriction math (cherry picked from commit 70d5ff32ab0aa67d0c6ca3b7e11cc6b761278cdd) --- .../github/common/storage/FluidCellInventory.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/glodblock/github/common/storage/FluidCellInventory.java b/src/main/java/com/glodblock/github/common/storage/FluidCellInventory.java index dc760010..3563ae10 100644 --- a/src/main/java/com/glodblock/github/common/storage/FluidCellInventory.java +++ b/src/main/java/com/glodblock/github/common/storage/FluidCellInventory.java @@ -159,6 +159,7 @@ public class FluidCellInventory implements IFluidCellInventory { final long bytesFree = this.getFreeBytes(); return (bytesFree > this.getBytesPerType() || (bytesFree == this.getBytesPerType() && this.getUnusedFluidCount() > 0)) + && (restrictionLong <= 0 || restrictionLong > getStoredFluidCount()) && this.getRemainingFluidTypes() > 0; } @@ -361,7 +362,12 @@ public class FluidCellInventory implements IFluidCellInventory { if (cardDistribution) { remainingFluidSlots = this.getRemainingFluidCountDist(l); } else { - remainingFluidSlots = this.getRemainingFluidCount(); + if (restrictionLong > 0) { + remainingFluidSlots = this.getRemainingFluidCount(); + } else { + remainingFluidSlots = this.getRemainingFluidCount() + - (long) this.getBytesPerType() * singleByteAmount; + } } if (remainingFluidSlots <= 0) {