From b6b34672517db7c5dc38cb8fdd9edb0e056e9701 Mon Sep 17 00:00:00 2001 From: GlodBlock <1356392126@qq.com> Date: Tue, 15 Nov 2022 15:18:00 +0800 Subject: [PATCH] fix block mode doesn't work in pure fluid pattern --- .../inventory/FluidConvertingInventoryAdaptor.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/java/com/glodblock/github/inventory/FluidConvertingInventoryAdaptor.java b/src/main/java/com/glodblock/github/inventory/FluidConvertingInventoryAdaptor.java index 712d294d..eed7d739 100644 --- a/src/main/java/com/glodblock/github/inventory/FluidConvertingInventoryAdaptor.java +++ b/src/main/java/com/glodblock/github/inventory/FluidConvertingInventoryAdaptor.java @@ -183,6 +183,10 @@ public class FluidConvertingInventoryAdaptor extends InventoryAdaptor { @Override public boolean containsItems() { + if (invFluids == null && invItems == null) { + // If this entity doesn't has fluid or item inventory, we just view it as full of things. + return true; + } if (invFluids != null && invFluids.getTankInfo(this.side) != null) { List tankInfos = new LinkedList<>(); if (invFluids instanceof TileCableBus && ((TileCableBus) invFluids).getPart(this.side) instanceof PartP2PLiquids) { @@ -212,14 +216,20 @@ public class FluidConvertingInventoryAdaptor extends InventoryAdaptor { } else { tankInfos.add(invFluids.getTankInfo(this.side)); } + boolean hasTank = false; for (FluidTankInfo[] tankInfoArray : tankInfos) { for (FluidTankInfo tank : tankInfoArray) { + hasTank = true; FluidStack fluid = tank.fluid; if (fluid != null && fluid.amount > 0) { return true; } } } + if (!hasTank && invItems == null) { + // If this entity doesn't has fluid or item inventory, we just view it as full of things. + return true; + } } return invItems != null && invItems.containsItems(); }