- /commandgui [gui] did not work, this has been fixed
- small channges
This commit is contained in:
JaTiTV 2021-12-22 19:47:35 +01:00
parent e0da2cd88d
commit 75b4a323c5

View File

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