mirror of
https://github.com/BlueMap-Minecraft/BlueMap.git
synced 2024-11-22 10:35:16 +01:00
Fix Caffeine using wrong thread-pool and add sorting to initial map-update
This commit is contained in:
parent
cef202ebba
commit
ae992419bb
@ -27,9 +27,11 @@ public class BlueMapAPIImpl extends BlueMapAPI {
|
|||||||
public BlueMapAPIImpl(Plugin plugin) {
|
public BlueMapAPIImpl(Plugin plugin) {
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
this.worldCache = Caffeine.newBuilder()
|
this.worldCache = Caffeine.newBuilder()
|
||||||
|
.executor(BlueMap.THREAD_POOL)
|
||||||
.weakKeys()
|
.weakKeys()
|
||||||
.build(this::getWorldUncached);
|
.build(this::getWorldUncached);
|
||||||
this.mapCache = Caffeine.newBuilder()
|
this.mapCache = Caffeine.newBuilder()
|
||||||
|
.executor(BlueMap.THREAD_POOL)
|
||||||
.weakKeys()
|
.weakKeys()
|
||||||
.build(this::getMapUncached);
|
.build(this::getMapUncached);
|
||||||
}
|
}
|
||||||
|
@ -194,11 +194,13 @@ public void load() throws IOException {
|
|||||||
renderManager = new RenderManager();
|
renderManager = new RenderManager();
|
||||||
|
|
||||||
//update all maps
|
//update all maps
|
||||||
for (BmMap map : maps.values()) {
|
maps.values().stream()
|
||||||
|
.sorted(Comparator.comparing(bmMap -> bmMap.getMapSettings().getSorting()))
|
||||||
|
.forEach(map -> {
|
||||||
if (pluginState.getMapState(map).isUpdateEnabled()) {
|
if (pluginState.getMapState(map).isUpdateEnabled()) {
|
||||||
renderManager.scheduleRenderTask(new MapUpdateTask(map));
|
renderManager.scheduleRenderTask(new MapUpdateTask(map));
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
|
|
||||||
//start render-manager
|
//start render-manager
|
||||||
if (pluginState.isRenderThreadsEnabled()) {
|
if (pluginState.isRenderThreadsEnabled()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user