From 576313bd3589eff0ae22815fccc8e99a458d4d77 Mon Sep 17 00:00:00 2001 From: "Blue (Lukas Rieger)" Date: Wed, 26 Aug 2020 14:12:10 +0200 Subject: [PATCH] Fix default plugin.conf not being generated correctly --- .../bluemap/common/BlueMapService.java | 11 ++++------ .../bluemap/common/plugin/Plugin.java | 21 ++++++++----------- 2 files changed, 13 insertions(+), 19 deletions(-) diff --git a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/BlueMapService.java b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/BlueMapService.java index ddb21bb7..cd674fd4 100644 --- a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/BlueMapService.java +++ b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/BlueMapService.java @@ -70,7 +70,6 @@ public class BlueMapService { private ThrowingFunction worldNameProvider; private ConfigManager configManager; - private boolean resourceConfigLoaded = false; private CoreConfig coreConfig; private RenderConfig renderConfig; @@ -168,10 +167,13 @@ private synchronized void loadWorldsAndMaps() throws IOException { continue; } + ConfigManager configManager = getConfigManager(); + configManager.loadResourceConfigs(configFolder, getResourcePack()); + World world = worlds.get(worldUUID); if (world == null) { try { - world = MCAWorld.load(worldFolder.toPath(), worldUUID, minecraftVersion, getConfigManager().getBlockIdConfig(), getConfigManager().getBlockPropertiesConfig(), getConfigManager().getBiomeConfig(), worldNameProvider.apply(worldUUID), true); + world = MCAWorld.load(worldFolder.toPath(), worldUUID, minecraftVersion, configManager.getBlockIdConfig(), configManager.getBlockPropertiesConfig(), configManager.getBiomeConfig(), worldNameProvider.apply(worldUUID), true); worlds.put(worldUUID, world); } catch (MissingResourcesException e) { throw e; // rethrow this to stop loading and display resource-missing message @@ -272,11 +274,6 @@ public synchronized ResourcePack getResourcePack() throws IOException, MissingRe } public synchronized ConfigManager getConfigManager() throws IOException { - if (!resourceConfigLoaded) { - configManager.loadResourceConfigs(configFolder, getResourcePack()); - resourceConfigLoaded = true; - } - return configManager; } diff --git a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/plugin/Plugin.java b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/plugin/Plugin.java index ef7e9a24..74a3d891 100644 --- a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/plugin/Plugin.java +++ b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/plugin/Plugin.java @@ -101,22 +101,19 @@ public synchronized void load() throws IOException, ParseResourceException { CoreConfig coreConfig = blueMap.getCoreConfig(); RenderConfig renderConfig = blueMap.getRenderConfig(); WebServerConfig webServerConfig = blueMap.getWebServerConfig(); + + //load plugin config + pluginConfig = new PluginConfig(blueMap.getConfigManager().loadOrCreate( + new File(serverInterface.getConfigFolder(), "plugin.conf"), + Plugin.class.getResource("/plugin.conf"), + Plugin.class.getResource("/plugin-defaults.conf"), + true, + true + )); //try load resources try { - - //load plugin config - pluginConfig = new PluginConfig(blueMap.getConfigManager().loadOrCreate( - new File(serverInterface.getConfigFolder(), "plugin.conf"), - Plugin.class.getResource("/plugin.conf"), - Plugin.class.getResource("/plugin-defaults.conf"), - true, - true - )); - - //make sure resources are loaded getResourcePack(); - } catch (MissingResourcesException ex) { Logger.global.logWarning("BlueMap is missing important resources!"); Logger.global.logWarning("You need to accept the download of the required files in order of BlueMap to work!");