Added drain code to FluidNetwork
This commit is contained in:
parent
1438e5eda7
commit
7f2cb49736
1 changed files with 11 additions and 1 deletions
|
@ -92,7 +92,17 @@ public class FluidNetwork extends Network<IFluidNetwork, IFluidPart, IFluidHandl
|
|||
@Override
|
||||
public FluidStack drain(IFluidPart source, ForgeDirection from, FluidStack resource, boolean doDrain)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
if (resource != null && resource.isFluidEqual(this.getTank().getFluid()))
|
||||
{
|
||||
FluidStack before = this.getTank().getFluid();
|
||||
FluidStack after = this.getTank().drain(resource.amount, doDrain);
|
||||
if (before != after || after == null || after.amount != before.amount)
|
||||
{
|
||||
this.loadPart = true;
|
||||
}
|
||||
|
||||
return after;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue