@Override public void updateEntity(World world) { super.updateEntity(world); if (world.isRemote) { return; } filledFromThisTick.clear(); updateStartPushDir(); doExtract(); if (stateDirty) { getBundle().dirty(); stateDirty = false; lastSyncRatio = tank.getFilledRatio(); } else if ((lastSyncRatio != tank.getFilledRatio() && world.getTotalWorldTime() % 2 == 0)) { // need to send a custom packet as we don't want want to trigger a full chunk update, just // need to get the required values to the entity renderer BlockCoord loc = getLocation(); PacketHandler.INSTANCE.sendToAllAround( new PacketFluidLevel(this), new TargetPoint(world.provider.dimensionId, loc.x, loc.y, loc.z, 64)); lastSyncRatio = tank.getFilledRatio(); } }
@Override protected void connectionsChanged() { super.connectionsChanged(); updateTank(); }