Fixed issues with the tank not syncing on the disel genertaor
This commit is contained in:
parent
cd04ae5693
commit
11fd755619
1 changed files with 13 additions and 5 deletions
|
@ -65,18 +65,26 @@ public class TileDieselGenerator extends TilePowerAcceptor implements IWrenchabl
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int fill(ForgeDirection from, FluidStack resource, boolean doFill) {
|
public int fill(ForgeDirection from, FluidStack resource, boolean doFill) {
|
||||||
return tank.fill(resource, doFill);
|
int filled = tank.fill(resource, doFill);
|
||||||
|
tank.compareAndUpdate();
|
||||||
|
return filled;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public FluidStack drain(ForgeDirection from, FluidStack resource,
|
public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain) {
|
||||||
boolean doDrain) {
|
if (resource == null || !resource.isFluidEqual(tank.getFluid())) {
|
||||||
return tank.drain(resource.amount, doDrain);
|
return null;
|
||||||
|
}
|
||||||
|
FluidStack fluidStack = tank.drain(resource.amount, doDrain);
|
||||||
|
tank.compareAndUpdate();
|
||||||
|
return fluidStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) {
|
public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) {
|
||||||
return tank.drain(maxDrain, doDrain);
|
FluidStack drained = tank.drain(maxDrain, doDrain);
|
||||||
|
tank.compareAndUpdate();
|
||||||
|
return drained;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue