From ef7a5d4d86bdc6ab2cddd3b87d2f597c5ffef664 Mon Sep 17 00:00:00 2001 From: lc-1337 <62835225+lc-1337@users.noreply.github.com> Date: Mon, 6 Oct 2025 16:38:01 +0300 Subject: [PATCH] make maintainer read fluid level (#339) --- .../github/common/tile/TileLevelMaintainer.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/glodblock/github/common/tile/TileLevelMaintainer.java b/src/main/java/com/glodblock/github/common/tile/TileLevelMaintainer.java index 438b61ec..eb8ae12c 100644 --- a/src/main/java/com/glodblock/github/common/tile/TileLevelMaintainer.java +++ b/src/main/java/com/glodblock/github/common/tile/TileLevelMaintainer.java @@ -163,7 +163,8 @@ public class TileLevelMaintainer extends AENetworkTile try { final ICraftingGrid craftingGrid = getProxy().getCrafting(); final IGrid grid = getProxy().getGrid(); - final IItemList inv = getProxy().getStorage().getItemInventory().getStorageList(); + final IItemList invItems = getProxy().getStorage().getItemInventory().getStorageList(); + final IItemList invFluid = getProxy().getStorage().getFluidInventory().getStorageList(); // Check there are available crafting CPUs before doing any work. // This hopefully stops level maintainers busy-looping calculating @@ -205,9 +206,16 @@ public class TileLevelMaintainer extends AENetworkTile } } - IAEItemStack aeItem = inv.findPrecise(craftItem); + IAEItemStack aeItem = invItems.findPrecise(craftItem); - long stackSize = aeItem == null ? 0 : aeItem.getStackSize(); + long stackSize; + + if (craftItem.getItem() instanceof ItemFluidDrop) { + IAEFluidStack ifs = invFluid.findPrecise(ItemFluidDrop.getAeFluidStack(craftItem)); + stackSize = ifs == null ? 0 : ifs.getStackSize(); + } else { + stackSize = aeItem == null ? 0 : aeItem.getStackSize(); + } if (ModAndClassUtil.ThE) { if (aeItem != null && ThaumicEnergisticsCrafting.isAspectStack(aeItem.getItemStack())) {