/* UPDATING */ @Override public void updateEntity() { if (CoreProxy.proxy.isRenderWorld(worldObj)) return; // Have liquid flow down into tanks below if any. if (tank.getFluid() != null) { moveFluidBelow(); } if (hasUpdate && tracker.markTimeIfDelay(worldObj, 2 * BuildCraftCore.updateFactor)) { sendNetworkUpdate(); hasUpdate = false; } }
public void moveFluidBelow() { TileTank below = getTankBelow(this); if (below == null) { return; } int used = below.tank.fill(tank.getFluid(), true); if (used > 0) { hasUpdate = true; // not redundant because tank.drain operates on an IFluidTank, not a tile below.hasUpdate = true; // redundant because below.fill sets hasUpdate tank.drain(used, true); } }
@Override public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain) { if (resource != null && !resource.isFluidEqual(tank.getFluid())) return null; return drain(from, resource.amount, doDrain); }