improvements to fluid io, fixes #635
This commit is contained in:
@@ -90,10 +90,11 @@ public class TileExporter extends TileMultipartNode implements IComparable, ITyp
|
|||||||
|
|
||||||
FluidStack took = network.extractFluid(stack, toExtract, compare, true);
|
FluidStack took = network.extractFluid(stack, toExtract, compare, true);
|
||||||
|
|
||||||
if (took != null && (toExtract - handler.fill(took, false)) == 0) {
|
if (took != null) {
|
||||||
took = network.extractFluid(stack, toExtract, compare, false);
|
int filled = handler.fill(took, false);
|
||||||
|
took = network.extractFluid(stack, filled, compare, false);
|
||||||
handler.fill(took, true);
|
handler.fill(took, true);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -95,10 +95,14 @@ public class TileImporter extends TileMultipartNode implements IComparable, IFil
|
|||||||
FluidStack stack = handler.drain(Fluid.BUCKET_VOLUME, false);
|
FluidStack stack = handler.drain(Fluid.BUCKET_VOLUME, false);
|
||||||
|
|
||||||
if (stack != null && IFilterable.canTakeFluids(fluidFilters, mode, compare, stack) && network.insertFluid(stack, stack.amount, true) == null) {
|
if (stack != null && IFilterable.canTakeFluids(fluidFilters, mode, compare, stack) && network.insertFluid(stack, stack.amount, true) == null) {
|
||||||
FluidStack drained = handler.drain(Fluid.BUCKET_VOLUME * upgrades.getInteractStackSize(), true);
|
FluidStack toDrain = handler.drain(Fluid.BUCKET_VOLUME * upgrades.getInteractStackSize(), false);
|
||||||
|
|
||||||
if (drained != null) {
|
if (toDrain != null) {
|
||||||
network.insertFluid(drained, drained.amount, false);
|
FluidStack remainder = network.insertFluid(toDrain, toDrain.amount, false);
|
||||||
|
if (remainder != null) {
|
||||||
|
toDrain.amount -= remainder.amount;
|
||||||
|
}
|
||||||
|
handler.drain(toDrain, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user