From f0adf351d180021fa4af89e7de13820714c05af1 Mon Sep 17 00:00:00 2001 From: Grzybol Date: Sun, 26 Nov 2023 22:56:43 +0100 Subject: [PATCH] -fixed /be reload --- pom.xml | 2 +- .../mine/game/betterelo/ExtendedConfigManager.java | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 675e9c8..9ce4ac2 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ betterbox.mine.game BetterElo - 3.0.22-SNAPSHOT + 3.0.23-SNAPSHOT jar BetterElo diff --git a/src/main/java/betterbox/mine/game/betterelo/ExtendedConfigManager.java b/src/main/java/betterbox/mine/game/betterelo/ExtendedConfigManager.java index 20c89b0..096fd8d 100644 --- a/src/main/java/betterbox/mine/game/betterelo/ExtendedConfigManager.java +++ b/src/main/java/betterbox/mine/game/betterelo/ExtendedConfigManager.java @@ -12,6 +12,7 @@ public class ExtendedConfigManager { private JavaPlugin plugin; private PluginLogger pluginLogger; List logLevels = null; + private File configFile = null; Set enabledLogLevels; public ExtendedConfigManager(JavaPlugin plugin, PluginLogger pluginLogger) { @@ -47,7 +48,7 @@ private void configureLogger() { public void ReloadConfig() { pluginLogger.log(PluginLogger.LogLevel.DEBUG, "ConfigManager: ReloadConfig called"); // Odczytanie ustawień log_level z pliku konfiguracyjnego - File configFile = new File(plugin.getDataFolder(), "config.yml"); + configFile = new File(plugin.getDataFolder(), "config.yml"); plugin.reloadConfig(); logLevels = plugin.getConfig().getStringList("log_level"); enabledLogLevels = new HashSet<>(); @@ -70,11 +71,13 @@ public void ReloadConfig() { plugin.getServer().getLogger().warning("Invalid log level in config: " + level); } } + pluginLogger.setEnabledLogLevels(enabledLogLevels); + } public void updateConfig(String configuration) { - File configFile = new File(plugin.getDataFolder(), "config.yml"); + configFile = new File(plugin.getDataFolder(), "config.yml"); if (!configFile.exists()) { pluginLogger.log(PluginLogger.LogLevel.WARNING, "Config file does not exist, creating new one.");