Fixes #774 and allows for similar features in the future

This commit is contained in:
Sauilitired 2016-01-16 13:03:51 +01:00
parent ad1272b0e5
commit c6f087fd50

View File

@ -372,6 +372,19 @@ public class MainCommand extends CommandManager<PlotPlayer> {
}
Command<PlotPlayer> cmd;
if (label != null) {
if (label.contains(":")) {
// Ref: c:v, this will push value to the last spot in the array
// ex. /p h:2 SomeUsername
// > /p h SomeUsername 2
String[] temp = label.split(":");
label = temp[0];
String[] tempArgs = new String[args.length + 1];
System.arraycopy(args, 0, tempArgs, 0, args.length);
tempArgs[tempArgs.length - 1] = temp[1];
args = tempArgs;
}
cmd = getInstance().commands.get(label.toLowerCase());
} else {
cmd = null;