mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 05:06:44 +01:00
Fix plot kick args
This commit is contained in:
parent
19ef76de33
commit
512ae38392
@ -35,6 +35,7 @@ import com.plotsquared.general.commands.CommandDeclaration;
|
||||
aliases = {"k"},
|
||||
description = "Kick a player from your plot",
|
||||
permission = "plots.kick",
|
||||
usage = "<player>",
|
||||
category = CommandCategory.TELEPORT,
|
||||
requiredType = RequiredType.PLAYER)
|
||||
public class Kick extends SubCommand {
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user