From 7f363ca34488f3d0bceba47efb99e860ae596515 Mon Sep 17 00:00:00 2001 From: LoJoSho Date: Tue, 15 Nov 2022 19:15:00 -0600 Subject: [PATCH] Moved Config Version Error --- .../hibiscusmc/hmccosmetics/HMCCosmeticsPlugin.java | 10 ---------- .../com/hibiscusmc/hmccosmetics/config/Settings.java | 12 +++++++++++- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/hibiscusmc/hmccosmetics/HMCCosmeticsPlugin.java b/src/main/java/com/hibiscusmc/hmccosmetics/HMCCosmeticsPlugin.java index 650abdc9..08136f1d 100644 --- a/src/main/java/com/hibiscusmc/hmccosmetics/HMCCosmeticsPlugin.java +++ b/src/main/java/com/hibiscusmc/hmccosmetics/HMCCosmeticsPlugin.java @@ -41,16 +41,6 @@ public final class HMCCosmeticsPlugin extends JavaPlugin { setup(); - if (Settings.getConfigVersion() == 0) { - getLogger().severe(""); - getLogger().severe(""); - getLogger().severe("Improper Configuration Found (Config Version Does Not Exist!)"); - getLogger().severe("Problems will happen with the plugin! Delete and regenerate a new one!"); - getLogger().severe(""); - getLogger().severe(""); - return; - } - // Commands getServer().getPluginCommand("cosmetic").setExecutor(new CosmeticCommand()); getServer().getPluginCommand("cosmetic").setTabCompleter(new CosmeticCommandTabComplete()); diff --git a/src/main/java/com/hibiscusmc/hmccosmetics/config/Settings.java b/src/main/java/com/hibiscusmc/hmccosmetics/config/Settings.java index c41e108e..c8a682fb 100644 --- a/src/main/java/com/hibiscusmc/hmccosmetics/config/Settings.java +++ b/src/main/java/com/hibiscusmc/hmccosmetics/config/Settings.java @@ -1,5 +1,6 @@ package com.hibiscusmc.hmccosmetics.config; +import com.hibiscusmc.hmccosmetics.HMCCosmeticsPlugin; import org.bukkit.util.Vector; import org.spongepowered.configurate.ConfigurationNode; @@ -36,6 +37,16 @@ public class Settings { defaultMenu = source.node(DEFAULT_MENU).getString(); configVersion = source.node(CONFIG_VERSION).getInt(0); + if (configVersion == 0) { + HMCCosmeticsPlugin plugin = HMCCosmeticsPlugin.getInstance(); + plugin.getLogger().severe(""); + plugin.getLogger().severe(""); + plugin.getLogger().severe("Improper Configuration Found (Config Version Does Not Exist!)"); + plugin.getLogger().severe("Problems will happen with the plugin! Delete and regenerate a new one!"); + plugin.getLogger().severe(""); + plugin.getLogger().severe(""); + return; + } ConfigurationNode cosmeticSettings = source.node(COSMETIC_SETTINGS_PATH); @@ -48,7 +59,6 @@ public class Settings { lookDownPitch = cosmeticSettings.node(LOOK_DOWN_PITCH_PATH).getInt(); viewDistance = cosmeticSettings.node(VIEW_DISTANCE_PATH).getInt(); - final var balloonSection = cosmeticSettings.node(BALLOON_OFFSET); if (balloonSection != null) {