diff --git a/build.gradle b/build.gradle index 3789c9b..36e9f46 100644 --- a/build.gradle +++ b/build.gradle @@ -47,7 +47,7 @@ dependencies { } group = 'me.byteful.plugin' -version = '1.2.5' +version = '1.2.5.1' description = 'LevelTools' java.sourceCompatibility = JavaVersion.VERSION_1_8 diff --git a/src/main/java/me/byteful/plugin/leveltools/LevelToolsCommand.java b/src/main/java/me/byteful/plugin/leveltools/LevelToolsCommand.java index 3c79187..fe40b1c 100644 --- a/src/main/java/me/byteful/plugin/leveltools/LevelToolsCommand.java +++ b/src/main/java/me/byteful/plugin/leveltools/LevelToolsCommand.java @@ -28,9 +28,8 @@ public void onReload(CommandSender sender) { return; } - if (!plugin.loadConfig()) { - return; - } + plugin.reloadConfig(); + plugin.setAnvilCombineMode(); sender.sendMessage( Text.colorize( Objects.requireNonNull(plugin.getConfig().getString("messages.successful_reload")))); diff --git a/src/main/java/me/byteful/plugin/leveltools/LevelToolsPlugin.java b/src/main/java/me/byteful/plugin/leveltools/LevelToolsPlugin.java index e644be0..85a443b 100644 --- a/src/main/java/me/byteful/plugin/leveltools/LevelToolsPlugin.java +++ b/src/main/java/me/byteful/plugin/leveltools/LevelToolsPlugin.java @@ -2,7 +2,6 @@ import co.aikar.commands.BukkitCommandManager; import co.aikar.commands.PaperCommandManager; -import com.tchristofferson.configupdater.ConfigUpdater; import me.byteful.plugin.leveltools.api.AnvilCombineMode; import me.byteful.plugin.leveltools.listeners.AnvilListener; import me.byteful.plugin.leveltools.listeners.BlockEventListener; @@ -12,7 +11,6 @@ import org.bukkit.plugin.java.JavaPlugin; import redempt.redlib.blockdata.BlockDataManager; -import java.io.File; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; @@ -70,9 +68,8 @@ public void onEnable() { blockDataManager.migrate(); getLogger().info("Loaded BlockDataManager..."); - if (!loadConfig()) { - return; - } + saveDefaultConfig(); + setAnvilCombineMode(); getLogger().info("Loaded configuration..."); registerListeners(); @@ -91,22 +88,6 @@ public void onEnable() { getLogger().info("Successfully started " + getDescription().getFullName() + "!"); } - boolean loadConfig() { - try { - saveDefaultConfig(); - ConfigUpdater.update(this, "config.yml", new File(getDataFolder(), "config.yml")); - reloadConfig(); - setAnvilCombineMode(); - - return true; - } catch (IOException e) { - e.printStackTrace(); - Bukkit.getPluginManager().disablePlugin(this); - } - - return false; - } - @Override public void onDisable() { if (blockDataManager != null) {