mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-16 10:44:47 +00:00
Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4d0e25d8e0 | ||
|
|
f8e31fc0c4 |
@@ -85,34 +85,31 @@ public class EnderLiquidConduitNetwork extends AbstractConduitNetwork<ILiquidCon
|
||||
return false;
|
||||
}
|
||||
|
||||
FluidTankInfo[] tankInfos = tank.externalTank.getTankInfo(conDir.getOpposite());
|
||||
if (tankInfos != null) {
|
||||
for (FluidTankInfo tankInfo : tankInfos) {
|
||||
if (tankInfo == null || tankInfo.fluid == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
FluidStack tryDrain = tankInfo.fluid.copy();
|
||||
tryDrain.amount = type.getMaxExtractPerTick();
|
||||
FluidStack drained = tank.externalTank.drain(conDir.getOpposite(), tryDrain, false);
|
||||
if (drained == null || drained.amount <= 0
|
||||
|| !matchedFilter(drained, con, conDir, true)
|
||||
|| !tryDrain.isFluidEqual(drained)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
int amountAccepted = fillFrom(tank, drained, true);
|
||||
if (amountAccepted <= 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
tryDrain.amount = amountAccepted;
|
||||
drained = tank.externalTank.drain(conDir.getOpposite(), tryDrain, true);
|
||||
if (drained == null || drained.amount <= 0) {
|
||||
continue;
|
||||
}
|
||||
return true;
|
||||
for (FluidTankInfo tankInfo : tank.externalTank.getTankInfo(conDir.getOpposite())) {
|
||||
if (tankInfo == null || tankInfo.fluid == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
FluidStack tryDrain = tankInfo.fluid.copy();
|
||||
tryDrain.amount = type.getMaxExtractPerTick();
|
||||
FluidStack drained = tank.externalTank.drain(conDir.getOpposite(), tryDrain, false);
|
||||
if (drained == null || drained.amount <= 0
|
||||
|| !matchedFilter(drained, con, conDir, true)
|
||||
|| !tryDrain.isFluidEqual(drained)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
int amountAccepted = fillFrom(tank, drained, true);
|
||||
if (amountAccepted <= 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
tryDrain.amount = amountAccepted;
|
||||
drained = tank.externalTank.drain(conDir.getOpposite(), tryDrain, true);
|
||||
if (drained == null || drained.amount <= 0) {
|
||||
continue;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
FluidStack drained = tank.externalTank.drain(conDir.getOpposite(), type.getMaxExtractPerTick(), false);
|
||||
|
||||
Reference in new issue
Block a user