fix block mode doesn't work in pure fluid pattern

This commit is contained in:
GlodBlock committed 2022-11-15 15:18:00 +08:00
1 parent 1c791480d5
commit b6b3467251
1 file changed
+10
@@ -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<FluidTankInfo[]> 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();
}