Fixed onCommand...
This commit is contained in:
parent
34a309b49f
commit
9adf449ef2
1 changed files with 3 additions and 3 deletions
|
@ -59,11 +59,11 @@ public class CommandCaller implements CommandExecutor {
|
||||||
public boolean onCommand(CommandSender sender, Command command, String alias, String[] args) {
|
public boolean onCommand(CommandSender sender, Command command, String alias, String[] args) {
|
||||||
String path = command.getName();
|
String path = command.getName();
|
||||||
for (String arg : args)
|
for (String arg : args)
|
||||||
path += "/" + arg;
|
path += " " + arg;
|
||||||
TBMCCommandBase cmd = TBMCChatAPI.GetCommands().get(path);
|
TBMCCommandBase cmd = TBMCChatAPI.GetCommands().get(path);
|
||||||
int argc = 0;
|
int argc = 0;
|
||||||
while (cmd == null && path.contains("/")) {
|
while (cmd == null && path.contains(" ")) {
|
||||||
path = path.substring(0, path.lastIndexOf('/'));
|
path = path.substring(0, path.lastIndexOf(' '));
|
||||||
argc++;
|
argc++;
|
||||||
cmd = TBMCChatAPI.GetCommands().get(path);
|
cmd = TBMCChatAPI.GetCommands().get(path);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue