added permission
This commit is contained in:
parent
b2ac9006c8
commit
a1a0b1b948
@ -149,15 +149,22 @@ public class Main extends JavaPlugin implements Listener, CommandExecutor
|
|||||||
|
|
||||||
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args){
|
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args){
|
||||||
if(cmd.getName().equalsIgnoreCase("tealimit")){
|
if(cmd.getName().equalsIgnoreCase("tealimit")){
|
||||||
if(args.length == 0){
|
|
||||||
sender.sendMessage("Invalid argument!");
|
if(sender.hasPermission("tealimit.admin")){
|
||||||
return false;
|
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")){
|
else{
|
||||||
sender.sendMessage("Reloading Configuration");
|
sender.sendMessage("Insufficient Permission!");
|
||||||
reloadConfig();
|
return false;
|
||||||
sender.sendMessage("Configuration Reloaded");
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -7,4 +7,6 @@ description: Limit entity spawns
|
|||||||
|
|
||||||
commands:
|
commands:
|
||||||
tealimit:
|
tealimit:
|
||||||
|
permission: tealimit.admin
|
||||||
description: Basic Command
|
description: Basic Command
|
||||||
|
usage: /<command> - usage
|
||||||
|
Loading…
Reference in New Issue
Block a user