From c9cf92ca4a706cc9d29c97c648f58f9e65dbde8c Mon Sep 17 00:00:00 2001 From: lordIcocain <62835225+lordIcocain@users.noreply.github.com> Date: Mon, 12 May 2025 17:21:33 +0300 Subject: [PATCH] Fix cell math for distribution card (#291) Co-authored-by: Maya <10861407+serenibyss@users.noreply.github.com> --- .../github/common/storage/FluidCellInventory.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) 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 436d458e..f1c54283 100644 --- a/src/main/java/com/glodblock/github/common/storage/FluidCellInventory.java +++ b/src/main/java/com/glodblock/github/common/storage/FluidCellInventory.java @@ -226,12 +226,9 @@ public class FluidCellInventory implements IFluidCellInventory { if (types == 0) types = this.getTotalFluidTypes(); if (l != null) { if (restrictionLong > 0) { - remaining = Math.min((restrictionLong / types) - l.getStackSize(), this.getUnusedFluidCount()); + remaining = Math.min((restrictionLong / types) - l.getStackSize(), getRemainingFluidCount()); } else { - remaining = (((this.getTotalBytes() / types) - - (int) Math.ceil((double) l.getStackSize() / singleByteAmount) - - getBytesPerType()) * singleByteAmount) - + (singleByteAmount - l.getStackSize() % singleByteAmount); + remaining = (((getTotalBytes() / types) - getBytesPerType()) * singleByteAmount) - l.getStackSize(); } } else { if (restrictionLong > 0) {