Skip to content

Commit

Permalink
Distribute chunk updates more evenly
Browse files Browse the repository at this point in the history
Signed-off-by: Ross Allan <rallanpcl@gmail.com>
  • Loading branch information
LunNova committed Jun 20, 2013
1 parent 67a7a14 commit c2a0c09
Showing 1 changed file with 1 addition and 2 deletions.
Expand Up @@ -32,12 +32,11 @@ public net.minecraft.util.LongHashMap getChunkWatchers() {
@Override
public void updatePlayerInstances() {
int currentTick = MinecraftServer.currentTick;
boolean squash = currentTick % 800 == 0;
ArrayList<PlayerInstance> postponed = new ArrayList<PlayerInstance>();
PlayerInstance playerInstance;
while ((playerInstance = chunkWatcherWithPlayersQ.poll()) != null) {
try {
if (playerInstance.shouldPostPone(squash, currentTick)) {
if (playerInstance.shouldPostPone(currentTick++ % 800 == 0, currentTick)) {
postponed.add(playerInstance);
} else {
playerInstance.sendChunkUpdate();
Expand Down

0 comments on commit c2a0c09

Please sign in to comment.