Top level commands are case insensitive. Thus sub commands should be as well.
This commit is contained in:
parent
722ce6b2a7
commit
3f3016c27e
@ -223,16 +223,19 @@ public class MCommand
|
|||||||
this.setCommandChain(commandChain);
|
this.setCommandChain(commandChain);
|
||||||
|
|
||||||
// Is there a matching sub command?
|
// Is there a matching sub command?
|
||||||
if (args.size() > 0 )
|
if (args.size() > 0)
|
||||||
{
|
{
|
||||||
for (MCommand subCommand: this.getSubCommands())
|
for (MCommand subCommand: this.getSubCommands())
|
||||||
{
|
{
|
||||||
if (subCommand.getAliases().contains(args.get(0)))
|
for (String alias : subCommand.getAliases())
|
||||||
{
|
{
|
||||||
args.remove(0);
|
if (args.get(0).equalsIgnoreCase(alias))
|
||||||
commandChain.add(this);
|
{
|
||||||
subCommand.execute(sender, args, commandChain);
|
args.remove(0);
|
||||||
return;
|
commandChain.add(this);
|
||||||
|
subCommand.execute(sender, args, commandChain);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user