Allow usage of -p jail players who's names are subcommands.

/jail -p version -r Having a strange name.
This commit is contained in:
graywolf336 2014-02-10 13:35:43 -06:00
parent 0f2ff60db7
commit e34c1d0990

View File

@ -52,7 +52,9 @@ public class JailCommand implements Command {
//This is just to add the -p param so jCommander doesn't blow up //This is just to add the -p param so jCommander doesn't blow up
List<String> arguments = new LinkedList<String>(Arrays.asList(args)); List<String> arguments = new LinkedList<String>(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(); Jailing params = new Jailing();