From c645d56085fffbdce9f46fceacae6396a6c3a886 Mon Sep 17 00:00:00 2001 From: Minecon724 Date: Sun, 22 Sep 2024 13:46:49 +0200 Subject: [PATCH] Make configs created automatically They weren't??? --- .../m724/realweather/RealWeatherPlugin.java | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/main/java/eu/m724/realweather/RealWeatherPlugin.java b/src/main/java/eu/m724/realweather/RealWeatherPlugin.java index 3ffb775..dc9f8dd 100644 --- a/src/main/java/eu/m724/realweather/RealWeatherPlugin.java +++ b/src/main/java/eu/m724/realweather/RealWeatherPlugin.java @@ -51,15 +51,8 @@ public class RealWeatherPlugin extends JavaPlugin { thunderConfiguration, timeConfiguration; DebugLogger.info("loading configurations", 1); - - if (!new File(dataFolder, "config.yml").exists()) { - logger.warning("This is the first time running this plugin."); - logger.warning("Please shut down the server, review the config files, and enter your API keys."); - - getServer().getPluginManager().disablePlugin(this); - return; - } - + boolean firstRun = !new File(dataFolder, "config.yml").exists(); + try { configuration = getConfig("config.yml"); mapConfiguration = getConfig("map.yml"); @@ -73,6 +66,14 @@ public class RealWeatherPlugin extends JavaPlugin { getServer().getPluginManager().disablePlugin(this); return; } + + if (firstRun) { + logger.warning("This is the first time running this plugin."); + logger.warning("Please shut down the server, review the config files, and enter your API keys."); + + getServer().getPluginManager().disablePlugin(this); + return; + } DebugLogger.baseLogger = logger; DebugLogger.debugLevel = configuration.getInt("debug");