From 8f56347572a77f8e79bc3549eab8c39cfc1849b5 Mon Sep 17 00:00:00 2001 From: Eric Stokes Date: Thu, 7 Jul 2011 21:32:21 -0600 Subject: [PATCH] Fixed ordering causing some commands to be read over MVModify --- src/com/onarandombox/MultiverseCore/MultiverseCore.java | 4 +++- src/com/onarandombox/MultiverseCore/command/BaseCommand.java | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/com/onarandombox/MultiverseCore/MultiverseCore.java b/src/com/onarandombox/MultiverseCore/MultiverseCore.java index cfbc1994..a8e2d08f 100644 --- a/src/com/onarandombox/MultiverseCore/MultiverseCore.java +++ b/src/com/onarandombox/MultiverseCore/MultiverseCore.java @@ -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)); } diff --git a/src/com/onarandombox/MultiverseCore/command/BaseCommand.java b/src/com/onarandombox/MultiverseCore/command/BaseCommand.java index fb4af106..aeff4f9e 100644 --- a/src/com/onarandombox/MultiverseCore/command/BaseCommand.java +++ b/src/com/onarandombox/MultiverseCore/command/BaseCommand.java @@ -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; } }