Skip to content

Commit

Permalink
Remove recently added config system due to major bug
Browse files Browse the repository at this point in the history
  • Loading branch information
byteful authored and byteful committed May 16, 2022
1 parent 8ce83c3 commit 79a319b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 25 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"))));
Expand Down
23 changes: 2 additions & 21 deletions src/main/java/me/byteful/plugin/leveltools/LevelToolsPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -70,9 +68,8 @@ public void onEnable() {
blockDataManager.migrate();
getLogger().info("Loaded BlockDataManager...");

if (!loadConfig()) {
return;
}
saveDefaultConfig();
setAnvilCombineMode();
getLogger().info("Loaded configuration...");

registerListeners();
Expand All @@ -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) {
Expand Down

0 comments on commit 79a319b

Please sign in to comment.