will check the config when plugin enables too
This commit is contained in:
@@ -40,6 +40,7 @@ public class Main extends Plugin implements Listener {
|
|||||||
msgs = BungeeMessages.getInstance(this);
|
msgs = BungeeMessages.getInstance(this);
|
||||||
|
|
||||||
config = new BungeeConfig(this);
|
config = new BungeeConfig(this);
|
||||||
|
checkConfig();
|
||||||
|
|
||||||
this.getProxy().getPluginManager().registerCommand(this, new MoveCommand(this));
|
this.getProxy().getPluginManager().registerCommand(this, new MoveCommand(this));
|
||||||
this.getProxy().getPluginManager().registerCommand(this, new ManageCommand(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() {
|
public BungeeConfig getConfig() {
|
||||||
return config;
|
return config;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,13 +31,7 @@ public class ManageCommand extends Command {
|
|||||||
}
|
}
|
||||||
msgs.reload();
|
msgs.reload();
|
||||||
pl.getConfig().reload();
|
pl.getConfig().reload();
|
||||||
List<String> svs = pl.getConfig().getStringList("queue-servers");
|
pl.checkConfig();
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
sender.sendMessage(msgs.getBC("commands.reload"));
|
sender.sendMessage(msgs.getBC("commands.reload"));
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user