added reload config command #1

Merged
DaemonicKing merged 2 commits from master into master 2020-05-12 13:30:59 +00:00
2 changed files with 17 additions and 8 deletions
Showing only changes of commit eed4a67069 - Show all commits

View File

@ -149,15 +149,22 @@ public class Main extends JavaPlugin implements Listener, CommandExecutor
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args){
if(cmd.getName().equalsIgnoreCase("tealimit")){
if(args.length == 0){
sender.sendMessage("Invalid argument!");
return false;
if(sender.hasPermission("tealimit.admin")){
if(args.length == 0){
sender.sendMessage("Invalid argument!");
return false;
}
if(args.length == 1 && args[0].equalsIgnoreCase("reload")){
sender.sendMessage("Reloading Configuration");
reloadConfig();
sender.sendMessage("Configuration Reloaded");
return true;
}
}
if(args.length == 1 && args[0].equalsIgnoreCase("reload")){
sender.sendMessage("Reloading Configuration");
reloadConfig();
sender.sendMessage("Configuration Reloaded");
return true;
else{
sender.sendMessage("Insufficient Permission!");
return false;
}
}
return false;

View File

@ -7,4 +7,6 @@ description: Limit entity spawns
commands:
tealimit:
permission: tealimit.admin
description: Basic Command
usage: /<command> - usage