will check the config when plugin enables too

This commit is contained in:
ajgeiss0702
2020-05-11 08:31:24 -07:00
parent d532c3dad6
commit 48d2eeb267
2 changed files with 12 additions and 7 deletions
+11
View File
@@ -40,6 +40,7 @@ public class Main extends Plugin implements Listener {
msgs = BungeeMessages.getInstance(this);
config = new BungeeConfig(this);
checkConfig();
this.getProxy().getPluginManager().registerCommand(this, new MoveCommand(this));
this.getProxy().getPluginManager().registerCommand(this, new ManageCommand(this));
@@ -71,6 +72,16 @@ public class Main extends Plugin implements Listener {
}
public void checkConfig() {
List<String> svs = getConfig().getStringList("queue-servers");
for(String s : svs) {
if(!s.contains(":")) {
getLogger().warning("The queue-servers section in the config has been set up incorrectly! Please read the comment above the setting and make sure you have a queue server and a destination server separated by a colon (:)");
break;
}
}
}
public BungeeConfig getConfig() {
return config;
}
@@ -31,13 +31,7 @@ public class ManageCommand extends Command {
}
msgs.reload();
pl.getConfig().reload();
List<String> svs = pl.getConfig().getStringList("queue-servers");
for(String s : svs) {
if(!s.contains(":")) {
pl.getLogger().warning("The queue-servers section in the config has been set up incorrectly! Please read the comment above the setting and make sure you have a queue server and a destination server separated by a colon (:)");
break;
}
}
pl.checkConfig();
sender.sendMessage(msgs.getBC("commands.reload"));
return;