From c6f087fd5055ff6fb72ba03fd73b04731abce651 Mon Sep 17 00:00:00 2001 From: Sauilitired Date: Sat, 16 Jan 2016 13:03:51 +0100 Subject: [PATCH] Fixes #774 and allows for similar features in the future --- .../plot/commands/MainCommand.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/main/java/com/intellectualcrafters/plot/commands/MainCommand.java b/src/main/java/com/intellectualcrafters/plot/commands/MainCommand.java index 5675781f6..fc3f27849 100644 --- a/src/main/java/com/intellectualcrafters/plot/commands/MainCommand.java +++ b/src/main/java/com/intellectualcrafters/plot/commands/MainCommand.java @@ -372,6 +372,19 @@ public class MainCommand extends CommandManager { } Command 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;