Compare commits

...
2 Commits
3 changed files with 32 additions and 31 deletions

No files matched your search

@@ -85,37 +85,38 @@ public class EnderLiquidConduitNetwork extends AbstractConduitNetwork<ILiquidCon
return false;
}
if (tank.externalTank.getTankInfo(conDir.getOpposite()) != null) {
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.copy(), 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);
if (drained == null || drained.amount <= 0 || !matchedFilter(drained, con, conDir, true)) {
return false;
}
int amountAccepted = fillFrom(tank, drained.copy(), true);
int amountAccepted = fillFrom(tank, drained, true);
if (amountAccepted <= 0) {
return false;
}
@@ -58,7 +58,7 @@ public class TileReservoir extends TileEntityEio implements IFluidHandler, ITank
}
}
static final FluidStack WATER_BUCKET = FluidRegistry.getFluidStack("water", BUCKET_VOLUME);
static final FluidStack WATER_BUCKET = new FluidStack(FluidRegistry.WATER, BUCKET_VOLUME);
BlockCoord[] multiblock = null;
@@ -156,7 +156,7 @@ public class TileReservoir extends TileEntityEio implements IFluidHandler, ITank
if (tank.getFluid() == null) {
return true;
}
if (fluid != null && fluid.getID() == tank.getFluid().getFluidID()) {
if (fluid != null && fluid == tank.getFluid().getFluid()) {
return true;
}
return false;
@@ -167,7 +167,7 @@ public class TileReservoir extends TileEntityEio implements IFluidHandler, ITank
if (tank.getFluid() == null || fluid == null) {
return false;
}
return tank.getFluid().getFluid().getID() == fluid.getID();
return tank.getFluid().getFluid() == fluid;
}
@Override
@@ -53,7 +53,7 @@ public class SmartTank extends FluidTank {
if (fl == null || fluid == null) {
return false;
}
return fl.getID() == fluid.getFluidID();
return fl == fluid.getFluid();
}
public FluidStack drain(FluidStack resource, boolean doDrain) {
@@ -67,7 +67,7 @@ public class SmartTank extends FluidTank {
if (fluid != null) {
return fluid.isFluidEqual(resource);
} else if (restriction != null) {
return resource.getFluid() != null && restriction.getID() == resource.getFluid().getID();
return resource.getFluid() != null && restriction == resource.getFluid();
} else {
return true;
}
@@ -75,9 +75,9 @@ public class SmartTank extends FluidTank {
public boolean canFill(Fluid fl) {
if (fluid != null) {
return fluid.getFluid().getID() == fl.getID();
return fluid.getFluid() == fl;
} else if (restriction != null) {
return restriction.getID() == fl.getID();
return restriction == fl;
} else {
return true;
}