Fixed issues with the tank not syncing on the disel genertaor

This commit is contained in:
Modmuss50 2015-09-10 19:39:00 +01:00
parent cd04ae5693
commit 11fd755619

View file

@ -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