From 3428c86f641f51b2c4829a826c6d6b3adb3b9107 Mon Sep 17 00:00:00 2001 From: RecursivePineapple Date: Mon, 9 Jun 2025 06:25:06 -0400 Subject: [PATCH] Fix div by zero (#306) --- .../com/glodblock/github/common/storage/FluidCellInventory.java | 2 +- 1 file changed, 1 insertion(+), 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 56f363ba..dc760010 100644 --- a/src/main/java/com/glodblock/github/common/storage/FluidCellInventory.java +++ b/src/main/java/com/glodblock/github/common/storage/FluidCellInventory.java @@ -200,7 +200,7 @@ public class FluidCellInventory implements IFluidCellInventory { @Override public long getRemainingFluidTypes() { - final long basedOnStorage = this.getFreeBytes() / this.getBytesPerType(); + final long basedOnStorage = this.getFreeBytes() / Math.max(1, this.getBytesPerType()); final long baseOnTotal = this.getTotalFluidTypes() - this.getStoredFluidTypes(); return Math.min(basedOnStorage, baseOnTotal); }