From 512ae38392d63c9a680577f656baff20a914a8ed Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Tue, 29 Mar 2016 18:57:35 +1100 Subject: [PATCH] Fix plot kick args --- .../java/com/intellectualcrafters/plot/commands/Kick.java | 1 + .../main/java/com/plotsquared/general/commands/Command.java | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/Core/src/main/java/com/intellectualcrafters/plot/commands/Kick.java b/Core/src/main/java/com/intellectualcrafters/plot/commands/Kick.java index bfb9f91d0..832dd6836 100644 --- a/Core/src/main/java/com/intellectualcrafters/plot/commands/Kick.java +++ b/Core/src/main/java/com/intellectualcrafters/plot/commands/Kick.java @@ -35,6 +35,7 @@ import com.plotsquared.general.commands.CommandDeclaration; aliases = {"k"}, description = "Kick a player from your plot", permission = "plots.kick", + usage = "", category = CommandCategory.TELEPORT, requiredType = RequiredType.PLAYER) public class Kick extends SubCommand { diff --git a/Core/src/main/java/com/plotsquared/general/commands/Command.java b/Core/src/main/java/com/plotsquared/general/commands/Command.java index 7081dba7a..f03e1538f 100644 --- a/Core/src/main/java/com/plotsquared/general/commands/Command.java +++ b/Core/src/main/java/com/plotsquared/general/commands/Command.java @@ -336,6 +336,11 @@ public abstract class Command { String[] baseSplit = getCommandString().split(" "); String[] fullSplit = getUsage().split(" "); String base = getCommandString(); + if (fullSplit.length - baseSplit.length < reqArgs.length) { + String[] tmp = new String[baseSplit.length + reqArgs.length]; + System.arraycopy(fullSplit, 0, tmp, 0, fullSplit.length); + fullSplit = tmp; + } for (int i = 0; i < reqArgs.length; i++) { fullSplit[i + baseSplit.length] = reqArgs[i].getExample().toString(); failed = failed || reqArgs[i].parse(args[i]) == null;