From e34c1d09908c4d2670c6daff8aac4ce20b3e0a50 Mon Sep 17 00:00:00 2001 From: graywolf336 Date: Mon, 10 Feb 2014 13:35:43 -0600 Subject: [PATCH] Allow usage of -p jail players who's names are subcommands. /jail -p version -r Having a strange name. --- .../com/graywolf336/jail/command/subcommands/JailCommand.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/graywolf336/jail/command/subcommands/JailCommand.java b/src/main/java/com/graywolf336/jail/command/subcommands/JailCommand.java index e3cf8c4..25c9ccf 100644 --- a/src/main/java/com/graywolf336/jail/command/subcommands/JailCommand.java +++ b/src/main/java/com/graywolf336/jail/command/subcommands/JailCommand.java @@ -52,7 +52,9 @@ public class JailCommand implements Command { //This is just to add the -p param so jCommander doesn't blow up List arguments = new LinkedList(Arrays.asList(args)); - arguments.add(0, "-p"); + //Only add the "-p" if it doesn't already contain it, this way people can do `/jail -p check` in the event someone + //has a name which is one of our subcommands + if(!arguments.contains("-p")) arguments.add(0, "-p"); Jailing params = new Jailing();