Don't send packets so much

This commit is contained in:
Raoul Van den Berge
2016-05-18 17:48:01 +02:00
parent 4023e87275
commit d150e82f40
4 changed files with 11 additions and 5 deletions

View File

@@ -191,8 +191,10 @@ public class TileController extends TileBase implements IEnergyReceiver, ISynchr
energy.setEnergyStored(energy.getMaxEnergyStored());
}
RefinedStorageUtils.sendToAllAround(worldObj, pos, new MessageControllerEnergyUpdate(this));
if (ticks % 4 == 0) {
RefinedStorageUtils.sendToAllAround(worldObj, pos, new MessageControllerEnergyUpdate(this));
}
if (lastEnergy != energy.getEnergyStored()) {
worldObj.updateComparatorOutputLevel(pos, RefinedStorageBlocks.CONTROLLER);
}

View File

@@ -91,7 +91,9 @@ public class TileDetector extends TileMachine implements ICompareConfig {
worldObj.notifyNeighborsOfStateChange(pos, RefinedStorageBlocks.DETECTOR);
}
RefinedStorageUtils.sendToAllAround(worldObj, pos, new MessageDetectorPoweredUpdate(this));
if (ticks % 4 == 0) {
RefinedStorageUtils.sendToAllAround(worldObj, pos, new MessageDetectorPoweredUpdate(this));
}
}
}

View File

@@ -75,7 +75,7 @@ public abstract class TileMachine extends TileBase implements ISynchronizedConta
}
}
if (!(this instanceof TileCable)) {
if (!(this instanceof TileCable) && ticks % 4 == 0) {
RefinedStorageUtils.sendToAllAround(worldObj, pos, new MessageMachineConnectedUpdate(this));
}
}

View File

@@ -77,7 +77,9 @@ public class TileSolderer extends TileMachine implements IInventory, ISidedInven
}
}
RefinedStorageUtils.sendToAllAround(worldObj, pos, new MessageSoldererWorkingUpdate(this));
if (ticks % 4 == 0) {
RefinedStorageUtils.sendToAllAround(worldObj, pos, new MessageSoldererWorkingUpdate(this));
}
}
@Override