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 @Override
public void reloadConfig() { public void reloadConfig() {
super.reloadConfig(); super.reloadConfig();
accentColor = ChatColor.valueOf(getConfig().getString("accent_color"));
saveDefaultConfig(); motds = (ArrayList<String>) getConfig().getStringList("motds");
config = getConfig(); joinMOTD = (ArrayList<String>) getConfig().getStringList("join_motd");
config.options().copyDefaults(true); serverName = getConfig().getString("server_name");
saveConfig(); saveConfig();
} }
public String formatDuration(Duration duration) { public String formatDuration(Duration duration) {

View File

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