Make the reload command actually work
This commit is contained in:
parent
84ea3c1928
commit
5bca346d02
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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.");
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue