Added a central way of limiting the syncs.
Tiles auto sync every 30 seconds they have a max so they can only sync 2 times a second
This commit is contained in:
parent
cdf8f3e0a3
commit
e930ea2a04
2 changed files with 14 additions and 7 deletions
|
@ -12,13 +12,20 @@ import cpw.mods.fml.relauncher.Side;
|
|||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class TileMachineBase extends TileEntity {
|
||||
private int facing;
|
||||
|
||||
public boolean needsSync = false;
|
||||
public int ticksSinceLastSync = 0;
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
super.updateEntity();
|
||||
// TODO make this happen less
|
||||
// syncWithAll();
|
||||
//Force a sync evey 30 seconds
|
||||
if(needsSync && ticksSinceLastSync >= 10 || ticksSinceLastSync == 600){
|
||||
syncWithAll();
|
||||
needsSync = false;
|
||||
ticksSinceLastSync = 0;
|
||||
}
|
||||
ticksSinceLastSync ++;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue