From 65f4f47cca92d144fc5d87fda9790284d28e333b Mon Sep 17 00:00:00 2001 From: graywolf336 Date: Wed, 12 Feb 2014 13:27:22 -0600 Subject: [PATCH] Convert the transfer jewel using args to arguments, removing 'transfer' --- .../jail/command/subcommands/JailCommand.java | 2 +- .../jail/command/subcommands/JailTransferCommand.java | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) 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 6e7d216..cd1c111 100644 --- a/src/main/java/com/graywolf336/jail/command/subcommands/JailCommand.java +++ b/src/main/java/com/graywolf336/jail/command/subcommands/JailCommand.java @@ -50,7 +50,7 @@ public class JailCommand implements Command { return true; } - //This is just to add the -p param so jCommander doesn't blow up + //This is just to add the -p param so CliFactory doesn't blow up List arguments = new LinkedList(Arrays.asList(args)); //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 diff --git a/src/main/java/com/graywolf336/jail/command/subcommands/JailTransferCommand.java b/src/main/java/com/graywolf336/jail/command/subcommands/JailTransferCommand.java index 4dabf67..dc73ad2 100644 --- a/src/main/java/com/graywolf336/jail/command/subcommands/JailTransferCommand.java +++ b/src/main/java/com/graywolf336/jail/command/subcommands/JailTransferCommand.java @@ -1,5 +1,9 @@ package com.graywolf336.jail.command.subcommands; +import java.util.Arrays; +import java.util.LinkedList; +import java.util.List; + import org.bukkit.ChatColor; import org.bukkit.command.CommandSender; @@ -28,11 +32,16 @@ public class JailTransferCommand implements Command { return true; } + //Convert to a List so we can edit the list + List arguments = new LinkedList(Arrays.asList(args)); + //remove the first argument of "transfer" + arguments.remove(0); + //Parse the command Transfer params = null; try { - params = CliFactory.parseArguments(Transfer.class, args); + params = CliFactory.parseArguments(Transfer.class, arguments.toArray(new String[arguments.size()])); }catch(ArgumentValidationException e) { sender.sendMessage(ChatColor.RED + e.getMessage()); return true;