mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-11-28 13:15:30 +01:00
Make workaround for adaptive - be faster when bukkit isn't tripping up
This commit is contained in:
parent
1862dc918c
commit
c74dd49f67
@ -296,8 +296,10 @@ public class MapManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private class ProcessChunkLoads implements Runnable {
|
private class ProcessChunkLoads implements Runnable {
|
||||||
|
long last_tick;
|
||||||
public void run() {
|
public void run() {
|
||||||
int cnt = max_chunk_loads_per_tick;
|
int cnt = max_chunk_loads_per_tick;
|
||||||
|
long tick = System.currentTimeMillis();
|
||||||
|
|
||||||
while(cnt > 0) {
|
while(cnt > 0) {
|
||||||
MapChunkCache c = chunkloads.peek();
|
MapChunkCache c = chunkloads.peek();
|
||||||
@ -311,8 +313,16 @@ public class MapManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(mapman.scheduler != null)
|
if(mapman.scheduler != null) {
|
||||||
mapman.scheduler.scheduleSyncDelayedTask(mapman.plug_in, this, 1);
|
/* Detect if bukkit is being stupid - add delay of 1 tick if we're being overfed */
|
||||||
|
if((tick - last_tick) >= 35) { /* If at least 35msec since last run, try immediate */
|
||||||
|
mapman.scheduler.scheduleSyncDelayedTask(mapman.plug_in, this);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
mapman.scheduler.scheduleSyncDelayedTask(mapman.plug_in, this, 1);
|
||||||
|
}
|
||||||
|
last_tick = tick;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user