Made more commands show in /u help (#57)
This commit is contained in:
parent
1fe200cf3f
commit
dc9bcd2cfd
1 changed files with 11 additions and 5 deletions
|
@ -35,10 +35,15 @@ public final class HelpCommand extends UCommandBase {
|
||||||
ArrayList<String> text = new ArrayList<String>();
|
ArrayList<String> text = new ArrayList<String>();
|
||||||
text.add("§6---- Command list ----");
|
text.add("§6---- Command list ----");
|
||||||
for (TBMCCommandBase cmd : TBMCChatAPI.GetCommands().values())
|
for (TBMCCommandBase cmd : TBMCChatAPI.GetCommands().values())
|
||||||
if (!cmd.GetCommandPath().contains(" "))
|
|
||||||
if (!cmd.GetModOnly() || PluginMain.permission.has(sender, "tbmc.admin"))
|
if (!cmd.GetModOnly() || PluginMain.permission.has(sender, "tbmc.admin"))
|
||||||
if (!cmd.GetPlayerOnly() || sender instanceof Player)
|
if (!cmd.GetPlayerOnly() || sender instanceof Player)
|
||||||
|
if (!cmd.GetCommandPath().contains(" "))
|
||||||
text.add("/" + cmd.GetCommandPath());
|
text.add("/" + cmd.GetCommandPath());
|
||||||
|
else {
|
||||||
|
final String topcmd = cmd.GetCommandPath().substring(0, cmd.GetCommandPath().indexOf(' '));
|
||||||
|
if (!text.contains("/" + topcmd))
|
||||||
|
text.add("/" + topcmd);
|
||||||
|
}
|
||||||
sender.sendMessage(text.toArray(new String[text.size()]));
|
sender.sendMessage(text.toArray(new String[text.size()]));
|
||||||
} else if (args[0].equalsIgnoreCase("colors")) {
|
} else if (args[0].equalsIgnoreCase("colors")) {
|
||||||
sender.sendMessage(new String[] { "§6---- Chat colors/formats ----", //
|
sender.sendMessage(new String[] { "§6---- Chat colors/formats ----", //
|
||||||
|
@ -65,7 +70,8 @@ public final class HelpCommand extends UCommandBase {
|
||||||
if (subcmds.length > 0)
|
if (subcmds.length > 0)
|
||||||
sender.sendMessage(subcmds);
|
sender.sendMessage(subcmds);
|
||||||
else
|
else
|
||||||
sender.sendMessage(new String[] { "§cError: Command not found or you don't have permission for it: " + path,
|
sender.sendMessage(
|
||||||
|
new String[] { "§cError: Command not found or you don't have permission for it: " + path,
|
||||||
"Usage example: /u accept --> /u help u accept" });
|
"Usage example: /u accept --> /u help u accept" });
|
||||||
} else
|
} else
|
||||||
sender.sendMessage(cmd.GetHelpText(args[0]));
|
sender.sendMessage(cmd.GetHelpText(args[0]));
|
||||||
|
|
Loading…
Reference in a new issue