Fix config reload command

This commit is contained in:
SeanOMik 2021-06-23 19:46:06 -04:00
parent d2b586feea
commit 63814427db
No known key found for this signature in database
GPG Key ID: CA09E5BE1F32728A
2 changed files with 7 additions and 0 deletions

View File

@ -57,6 +57,7 @@ public class CommandSpawnTamableFox implements TabExecutor {
break; break;
case "reload": case "reload":
plugin.reloadConfig(); plugin.reloadConfig();
Config.reloadConfig(plugin);
LanguageConfig.getConfig(plugin).reloadConfig(); LanguageConfig.getConfig(plugin).reloadConfig();
player.sendMessage(Config.getPrefix() + ChatColor.GREEN + LanguageConfig.getReloadMessage()); player.sendMessage(Config.getPrefix() + ChatColor.GREEN + LanguageConfig.getReloadMessage());
break; break;

View File

@ -3,10 +3,16 @@ package net.seanomik.tamablefoxes.util.io;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;
public class Config { public class Config {
private static FileConfiguration config = null; private static FileConfiguration config = null;
public static void reloadConfig(Plugin plugin) {
plugin.reloadConfig();
Config.config = plugin.getConfig();
}
public static void setConfig(FileConfiguration config) { public static void setConfig(FileConfiguration config) {
Config.config = config; Config.config = config;
} }