From 30169b698f0ed9eab2c2f9a98ac8d58de16a1317 Mon Sep 17 00:00:00 2001 From: Ryder Belserion Date: Mon, 22 Jul 2024 22:37:33 -0400 Subject: [PATCH] verbose-logging config option wasn't applying to everything in the plugin. --- CHANGELOG.md | 3 +++ .../java/com/badbones69/crazycrates/CrazyCrates.java | 12 +++++++++++- .../commands/crates/types/admin/CommandReload.java | 3 +++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 761715c94..a7ff97e2e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,5 +5,8 @@ Items: - 'Item:spawner, Glowing:true' ``` +### Fixed: +- The config option for `verbose-logging` was not applied to some parts of the plugin. + ### Changes: - No longer add the contents of `DisplayData` to the `Items` section on `/crazycrates reload` \ No newline at end of file diff --git a/src/main/java/com/badbones69/crazycrates/CrazyCrates.java b/src/main/java/com/badbones69/crazycrates/CrazyCrates.java index 25dabde1e..c60c55a76 100644 --- a/src/main/java/com/badbones69/crazycrates/CrazyCrates.java +++ b/src/main/java/com/badbones69/crazycrates/CrazyCrates.java @@ -7,6 +7,8 @@ import com.badbones69.crazycrates.api.objects.other.Server; import com.badbones69.crazycrates.api.utils.MiscUtils; import com.badbones69.crazycrates.commands.CommandManager; +import com.badbones69.crazycrates.config.ConfigManager; +import com.badbones69.crazycrates.config.impl.ConfigKeys; import com.badbones69.crazycrates.listeners.BrokeLocationsListener; import com.badbones69.crazycrates.listeners.CrateControlListener; import com.badbones69.crazycrates.listeners.MiscListener; @@ -55,13 +57,17 @@ public CrazyCrates() { private Server instance; + private VitalPaper paper; + @Override public void onEnable() { - new VitalPaper(this); + this.paper = new VitalPaper(this); this.instance = new Server(getDataFolder()); this.instance.apply(); + this.paper.setLogging(ConfigManager.getConfig().getProperty(ConfigKeys.verbose_logging)); + this.fileManager = new FileManager(); this.fileManager.addFile("locations.yml").addFile("data.yml") .addFolder("crates") @@ -194,4 +200,8 @@ public void onDisable() { public @NotNull final Timer getTimer() { return this.timer; } + + public final VitalPaper getPaper() { + return this.paper; + } } \ No newline at end of file diff --git a/src/main/java/com/badbones69/crazycrates/commands/crates/types/admin/CommandReload.java b/src/main/java/com/badbones69/crazycrates/commands/crates/types/admin/CommandReload.java index bd05c5c39..90aa75948 100644 --- a/src/main/java/com/badbones69/crazycrates/commands/crates/types/admin/CommandReload.java +++ b/src/main/java/com/badbones69/crazycrates/commands/crates/types/admin/CommandReload.java @@ -3,6 +3,7 @@ import com.badbones69.crazycrates.api.enums.Files; import com.badbones69.crazycrates.api.enums.Messages; import com.badbones69.crazycrates.commands.crates.types.BaseCommand; +import com.badbones69.crazycrates.config.ConfigManager; import dev.triumphteam.cmd.bukkit.annotation.Permission; import dev.triumphteam.cmd.core.annotations.Command; import org.bukkit.command.CommandSender; @@ -19,6 +20,8 @@ public void reload(CommandSender sender) { this.fileManager.reloadFiles().init(); + this.plugin.getPaper().setLogging(ConfigManager.getConfig().getProperty(ConfigKeys.verbose_logging)); + final YamlConfiguration locations = Files.locations.getConfiguration(); final YamlConfiguration data = Files.data.getConfiguration();