- /commandgui [gui] did not work, this has been fixed
- small channges
pull/1/head
JaTiTV 5 months ago
parent
commit
75b4a323c5
  1. 26
      CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/cmdManagement/CmdExecuter_GUI.java

26
CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/cmdManagement/CmdExecuter_GUI.java

@ -30,30 +30,33 @@ public class CmdExecuter_GUI implements CommandExecutor, TabCompleter { @@ -30,30 +30,33 @@ public class CmdExecuter_GUI implements CommandExecutor, TabCompleter {
}
Player player = (Player) sender;
Commands.gui(player);
} else {
if (args[0].equals("admin")) {
if (args.length == 1) {
Help.sendHelp(sender, prefix);
return false;
}
switch (args[1].toLowerCase()) {
case "info":
if (sender.hasPermission("commandgui.command.info")) {
Commands.info(sender);
} else sender.sendMessage(SelectMessages.NoPermissionForCommand
.replace("[cmd]", "/commandguiadmin").replace("[perm]", "commandgui.command.info"));
.replace("[cmd]", "/commandgui admin").replace("[perm]", "commandgui.command.info"));
break;
case "reload":
case "rl":
if (sender.hasPermission("commandgui.admin")) {
Commands.reload(sender);
} else sender.sendMessage(SelectMessages.NoPermissionForCommand
.replace("[cmd]", "/commandguiadmin").replace("[perm]", "commandgui.admin"));
.replace("[cmd]", "/commandgui admin").replace("[perm]", "commandgui.admin"));
break;
case "createdefaultgui":
if (sender.hasPermission("commandgui.admin")) {
DefaultGUICreate.configCreate();
sender.sendMessage(SelectMessages.DefaultGUIcreate.replace("[directory]", Main.getPath() + "/GUIs/default.yml"));
} else sender.sendMessage(SelectMessages.NoPermissionForCommand
.replace("[cmd]", "/commandguiadmin").replace("[perm]", "commandgui.admin"));
.replace("[cmd]", "/commandgui admin").replace("[perm]", "commandgui.admin"));
break;
case "debug":
if (sender.hasPermission("commandgui.admin")) {
@ -70,7 +73,7 @@ public class CmdExecuter_GUI implements CommandExecutor, TabCompleter { @@ -70,7 +73,7 @@ public class CmdExecuter_GUI implements CommandExecutor, TabCompleter {
} else Debug.debugmsg();
*/
} else sender.sendMessage(SelectMessages.NoPermissionForCommand.replace("[cmd]", "/commandguiadmin").replace("[perm]", "commandgui.admin"));
} else sender.sendMessage(SelectMessages.NoPermissionForCommand.replace("[cmd]", "/commandgui admin").replace("[perm]", "commandgui.admin"));
break;
case "give":
@ -86,10 +89,15 @@ public class CmdExecuter_GUI implements CommandExecutor, TabCompleter { @@ -86,10 +89,15 @@ public class CmdExecuter_GUI implements CommandExecutor, TabCompleter {
default:
Help.sendHelp(sender, prefix);
break;
}
} else Help.sendHelp(sender, prefix);
} else {
if (sender instanceof Player) {
Player player = (Player) sender;
Commands.gui(player, args[0]);
return false;
}
Help.sendHelp(sender, prefix);
}
}
return false;

Loading…
Cancel
Save