Fixed onCommand...

This commit is contained in:
Norbi Peti 2016-11-03 22:03:12 +01:00
parent 34a309b49f
commit 9adf449ef2

View file

@ -59,11 +59,11 @@ public class CommandCaller implements CommandExecutor {
public boolean onCommand(CommandSender sender, Command command, String alias, String[] args) {
String path = command.getName();
for (String arg : args)
path += "/" + arg;
path += " " + arg;
TBMCCommandBase cmd = TBMCChatAPI.GetCommands().get(path);
int argc = 0;
while (cmd == null && path.contains("/")) {
path = path.substring(0, path.lastIndexOf('/'));
while (cmd == null && path.contains(" ")) {
path = path.substring(0, path.lastIndexOf(' '));
argc++;
cmd = TBMCChatAPI.GetCommands().get(path);
}