Make the reload command actually work

This commit is contained in:
cloudwithax 2022-08-13 04:03:09 -04:00
parent 84ea3c1928
commit 5bca346d02
2 changed files with 7 additions and 4 deletions

View File

@ -74,11 +74,13 @@ public class Plugin extends JavaPlugin {
@Override
public void reloadConfig() {
super.reloadConfig();
saveDefaultConfig();
config = getConfig();
config.options().copyDefaults(true);
accentColor = ChatColor.valueOf(getConfig().getString("accent_color"));
motds = (ArrayList<String>) getConfig().getStringList("motds");
joinMOTD = (ArrayList<String>) getConfig().getStringList("join_motd");
serverName = getConfig().getString("server_name");
saveConfig();
}
public String formatDuration(Duration duration) {

View File

@ -22,6 +22,7 @@ public class ReloadCommand implements CommandExecutor {
if (sender != null) {
try {
plugin.reloadConfig();
player.sendMessage(ChatColor.GREEN + "Plugin config reloaded!");
} catch (Exception e){
player.sendMessage(ChatColor.RED + "Hey stupid! Check the console, you fucked up.");
}