mirror of
https://github.com/BlueMap-Minecraft/BlueMap.git
synced 2024-12-25 18:37:41 +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) {
|
||||
this.plugin = plugin;
|
||||
this.worldCache = Caffeine.newBuilder()
|
||||
.executor(BlueMap.THREAD_POOL)
|
||||
.weakKeys()
|
||||
.build(this::getWorldUncached);
|
||||
this.mapCache = Caffeine.newBuilder()
|
||||
.executor(BlueMap.THREAD_POOL)
|
||||
.weakKeys()
|
||||
.build(this::getMapUncached);
|
||||
}
|
||||
|
@ -194,11 +194,13 @@ public void load() throws IOException {
|
||||
renderManager = new RenderManager();
|
||||
|
||||
//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()) {
|
||||
renderManager.scheduleRenderTask(new MapUpdateTask(map));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//start render-manager
|
||||
if (pluginState.isRenderThreadsEnabled()) {
|
||||
|
Loading…
Reference in New Issue
Block a user