Fix default plugin.conf not being generated correctly

This commit is contained in:
Blue (Lukas Rieger) 2020-08-26 14:12:10 +02:00
parent c8523c1696
commit 576313bd35
2 changed files with 13 additions and 19 deletions

View File

@ -70,7 +70,6 @@ public class BlueMapService {
private ThrowingFunction<UUID, String, IOException> 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;
}

View File

@ -102,9 +102,6 @@ public synchronized void load() throws IOException, ParseResourceException {
RenderConfig renderConfig = blueMap.getRenderConfig();
WebServerConfig webServerConfig = blueMap.getWebServerConfig();
//try load resources
try {
//load plugin config
pluginConfig = new PluginConfig(blueMap.getConfigManager().loadOrCreate(
new File(serverInterface.getConfigFolder(), "plugin.conf"),
@ -114,9 +111,9 @@ public synchronized void load() throws IOException, ParseResourceException {
true
));
//make sure resources are loaded
//try load resources
try {
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!");