Fixed subcommands
This commit is contained in:
parent
ed4cb11b87
commit
7f45f08b32
1 changed files with 6 additions and 6 deletions
|
@ -61,16 +61,16 @@ public class TBMCChatAPI {
|
||||||
};
|
};
|
||||||
for (TBMCCommandBase cmd : TBMCChatAPI.GetCommands().values()) {
|
for (TBMCCommandBase cmd : TBMCChatAPI.GetCommands().values()) {
|
||||||
if (cmd.GetCommandPath().startsWith(command + " ")) {
|
if (cmd.GetCommandPath().startsWith(command + " ")) {
|
||||||
|
if (cmd.GetPlayerOnly() && !(sender instanceof Player))
|
||||||
|
continue;
|
||||||
|
if (cmd.GetModOnly() && !MainPlugin.permission.has(sender, "tbmc.admin"))
|
||||||
|
continue;
|
||||||
int ind = cmd.GetCommandPath().indexOf(' ', command.length() + 2);
|
int ind = cmd.GetCommandPath().indexOf(' ', command.length() + 2);
|
||||||
if (ind >= 0) {
|
if (ind >= 0) {
|
||||||
String newcmd = cmd.GetCommandPath().substring(0, ind);
|
String newcmd = cmd.GetCommandPath().substring(0, ind);
|
||||||
if (!cmds.contains("/" + newcmd))
|
if (!cmds.contains("/" + newcmd))
|
||||||
addToCmds.accept("/" + newcmd);
|
addToCmds.accept("/" + newcmd);
|
||||||
}
|
} else
|
||||||
if (cmd.GetPlayerOnly() && !(sender instanceof Player))
|
|
||||||
continue;
|
|
||||||
if (cmd.GetModOnly() && !MainPlugin.permission.has(sender, "tbmc.admin"))
|
|
||||||
continue;
|
|
||||||
addToCmds.accept("/" + cmd.GetCommandPath());
|
addToCmds.accept("/" + cmd.GetCommandPath());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue