Fixed ordering causing some commands to be read over MVModify

This commit is contained in:
Eric Stokes 2011-07-07 21:32:21 -06:00
parent 0187a600b3
commit 8f56347572
2 changed files with 4 additions and 3 deletions

View File

@ -183,11 +183,13 @@ public class MultiverseCore extends JavaPlugin {
this.commandManager.addCommand(new ConfirmCommand(this));
this.commandManager.addCommand(new InfoCommand(this));
this.commandManager.addCommand(new ReloadCommand(this));
this.commandManager.addCommand(new ModifyCommand(this));
this.commandManager.addCommand(new ModifyAddCommand(this));
this.commandManager.addCommand(new ModifySetCommand(this));
this.commandManager.addCommand(new ModifyRemoveCommand(this));
this.commandManager.addCommand(new ModifyClearCommand(this));
// This modify MUST go last.
this.commandManager.addCommand(new ModifyCommand(this));
this.commandManager.addCommand(new EnvironmentCommand(this));
this.commandManager.addCommand(new PurgeCommand(this));
}

View File

@ -47,12 +47,11 @@ public abstract class BaseCommand {
String argsString = this.getArgsString(args);
String lower = input.toLowerCase() + argsString;
System.out.print("Trying to match Identifer: " + lower);
int index = -1;
int n = this.identifiers.size();
for (int i = 0; i < n; i++) {
String identifier = this.identifiers.get(i).toLowerCase();
if (lower.matches(identifier + "(\\s+.*|\\s*)")) {
if (index == -1 && lower.matches(identifier + "(\\s+.*|\\s*)")) {
index = i;
}
}