Resolves Multi-Fluid Distribution Limit Check Only Evaluating First 5 Partition Slots (#362)

This commit is contained in:
Litten authored and GitHub committed 2025-11-13 18:44:17 +01:00
1 parent 0d5f682d3a
commit 219f8c313a
1 file changed
+7 -3
@@ -219,12 +219,16 @@ public class FluidCellInventory implements IFluidCellInventory {
public long getRemainingFluidCountDist(IAEFluidStack l) {
long remaining;
long types = 0;
for (int i = 0; i < this.getTotalFluidTypes(); i++) {
if (this.getConfigInventory().getStackInSlot(i) != null) {
long maxFluidTypes = this.getTotalFluidTypes();
IInventory configInventory = this.getConfigInventory();
for (int i = 0; i < configInventory.getSizeInventory(); i++) {
// Check all partition slots to determine min distribution behaviour until max fluid types is reached
if (types >= maxFluidTypes) break;
if (configInventory.getStackInSlot(i) != null) {
types++;
}
}
if (types == 0) types = this.getTotalFluidTypes();
if (types == 0) types = maxFluidTypes;
if (l != null) {
if (restrictionLong > 0) {
remaining = Math.min((restrictionLong / types) - l.getStackSize(), getRemainingFluidCount());