Adjust ticklist workaround to handle nether's tendancy to have ticklist processed events beget new ticklist events, more or less constantly....
This commit is contained in:
parent
4a3e95a118
commit
9c0f33bd3d
1 changed files with 6 additions and 4 deletions
|
|
@ -10,6 +10,7 @@ import java.util.TreeSet;
|
||||||
|
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.Chunk;
|
import org.bukkit.Chunk;
|
||||||
|
import org.bukkit.World.Environment;
|
||||||
import org.bukkit.block.Biome;
|
import org.bukkit.block.Biome;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.ChunkSnapshot;
|
import org.bukkit.ChunkSnapshot;
|
||||||
|
|
@ -444,9 +445,7 @@ public class NewMapChunkCache implements MapChunkCache {
|
||||||
if(iterator == null)
|
if(iterator == null)
|
||||||
iterator = chunks.listIterator();
|
iterator = chunks.listIterator();
|
||||||
|
|
||||||
if(checkTickList() == false) { /* Tick processing is behind? */
|
checkTickList();
|
||||||
max_to_load = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
DynmapPlugin.setIgnoreChunkLoads(true);
|
DynmapPlugin.setIgnoreChunkLoads(true);
|
||||||
//boolean isnormral = w.getEnvironment() == Environment.NORMAL;
|
//boolean isnormral = w.getEnvironment() == Environment.NORMAL;
|
||||||
|
|
@ -485,6 +484,7 @@ public class NewMapChunkCache implements MapChunkCache {
|
||||||
snaparray[(chunk.x-x_min) + (chunk.z - z_min)*x_dim] = ss;
|
snaparray[(chunk.x-x_min) + (chunk.z - z_min)*x_dim] = ss;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
long tt0 = 0;
|
||||||
chunks_attempted++;
|
chunks_attempted++;
|
||||||
boolean wasLoaded = w.isChunkLoaded(chunk.x, chunk.z);
|
boolean wasLoaded = w.isChunkLoaded(chunk.x, chunk.z);
|
||||||
boolean didload = w.loadChunk(chunk.x, chunk.z, false);
|
boolean didload = w.loadChunk(chunk.x, chunk.z, false);
|
||||||
|
|
@ -748,11 +748,13 @@ public class NewMapChunkCache implements MapChunkCache {
|
||||||
boolean isok = true;
|
boolean isok = true;
|
||||||
if((ourticklist != null) && (processticklist != null)) {
|
if((ourticklist != null) && (processticklist != null)) {
|
||||||
int cnt = 0;
|
int cnt = 0;
|
||||||
while((cnt < MAX_PROCESSTICKS) && (ourticklist.size() > MAX_TICKLIST)) {
|
int ticksize = ourticklist.size();
|
||||||
|
while((cnt < MAX_PROCESSTICKS) && (ticksize > MAX_TICKLIST) && (ourticklist.size() > MAX_TICKLIST)) {
|
||||||
try {
|
try {
|
||||||
processticklist.invoke(craftworld, true);
|
processticklist.invoke(craftworld, true);
|
||||||
} catch (Exception x) {
|
} catch (Exception x) {
|
||||||
}
|
}
|
||||||
|
ticksize -= 1000;
|
||||||
cnt++;
|
cnt++;
|
||||||
MapManager.mapman.incExtraTickList();
|
MapManager.mapman.incExtraTickList();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue