feat: make the portal reload command usable from the console and rcon (#338)

This commit is contained in:
Tad Hunt 2022-12-15 04:40:15 -07:00 committed by GitHub
parent 5229339a8c
commit b0a93c2c35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 0 deletions

View File

@ -55,6 +55,15 @@ public class AdvancedPortalsCommand implements CommandExecutor, TabCompleter {
ConfigAccessor config = new ConfigAccessor(plugin, "config.yml");
ConfigAccessor portalConfig = new ConfigAccessor(plugin, "portals.yml");
if (!(sender instanceof Player)) {
if(args.length == 1) {
if(args[0].equalsIgnoreCase("reload")) {
Listeners.reloadValues(plugin);
Portal.loadPortals();
sender.sendMessage("portal reloaded.");
return true;
}
}
sender.sendMessage(PluginMessages.customPrefixFail + " You cannot use commands with the console.");
return true;
}