@@ -1,11 +1,11 @@
|
||||
package org.bukkit.command;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import org.apache.commons.lang.Validate;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.GameRule;
|
||||
@@ -93,9 +93,9 @@ public abstract class Command {
|
||||
|
||||
@NotNull
|
||||
private List<String> tabComplete0(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args, @Nullable Location location) throws IllegalArgumentException {
|
||||
Validate.notNull(sender, "Sender cannot be null");
|
||||
Validate.notNull(args, "Arguments cannot be null");
|
||||
Validate.notNull(alias, "Alias cannot be null");
|
||||
Preconditions.checkArgument(sender != null, "Sender cannot be null");
|
||||
Preconditions.checkArgument(args != null, "Arguments cannot be null");
|
||||
Preconditions.checkArgument(alias != null, "Alias cannot be null");
|
||||
|
||||
if (args.length == 0) {
|
||||
return ImmutableList.of();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package org.bukkit.command;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import java.util.List;
|
||||
import org.apache.commons.lang.Validate;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -128,9 +128,9 @@ public final class PluginCommand extends Command implements PluginIdentifiableCo
|
||||
@NotNull
|
||||
@Override
|
||||
public java.util.List<String> tabComplete(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) throws CommandException, IllegalArgumentException {
|
||||
Validate.notNull(sender, "Sender cannot be null");
|
||||
Validate.notNull(args, "Arguments cannot be null");
|
||||
Validate.notNull(alias, "Alias cannot be null");
|
||||
Preconditions.checkArgument(sender != null, "Sender cannot be null");
|
||||
Preconditions.checkArgument(args != null, "Arguments cannot be null");
|
||||
Preconditions.checkArgument(alias != null, "Alias cannot be null");
|
||||
|
||||
List<String> completions = null;
|
||||
try {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.bukkit.command;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
@@ -8,7 +9,6 @@ import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import org.apache.commons.lang.Validate;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.command.defaults.BukkitCommand;
|
||||
@@ -181,8 +181,8 @@ public class SimpleCommandMap implements CommandMap {
|
||||
@Override
|
||||
@Nullable
|
||||
public List<String> tabComplete(@NotNull CommandSender sender, @NotNull String cmdLine, @Nullable Location location) {
|
||||
Validate.notNull(sender, "Sender cannot be null");
|
||||
Validate.notNull(cmdLine, "Command line cannot null");
|
||||
Preconditions.checkArgument(sender != null, "Sender cannot be null");
|
||||
Preconditions.checkArgument(cmdLine != null, "Command line cannot null");
|
||||
|
||||
int spaceIndex = cmdLine.indexOf(' ');
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package org.bukkit.command.defaults;
|
||||
|
||||
import com.google.common.base.Joiner;
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
@@ -8,10 +10,6 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.TreeSet;
|
||||
import org.apache.commons.lang.ArrayUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang.Validate;
|
||||
import org.apache.commons.lang.math.NumberUtils;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@@ -45,10 +43,10 @@ public class HelpCommand extends BukkitCommand {
|
||||
if (args.length == 0) {
|
||||
command = "";
|
||||
pageNumber = 1;
|
||||
} else if (NumberUtils.isDigits(args[args.length - 1])) {
|
||||
command = StringUtils.join(ArrayUtils.subarray(args, 0, args.length - 1), " ");
|
||||
} else if (args[args.length - 1].chars().allMatch(Character::isDigit)) {
|
||||
command = Joiner.on(" ").join(Arrays.copyOfRange(args, 0, args.length - 1));
|
||||
try {
|
||||
pageNumber = NumberUtils.createInteger(args[args.length - 1]);
|
||||
pageNumber = Integer.decode(args[args.length - 1]);
|
||||
} catch (NumberFormatException exception) {
|
||||
pageNumber = 1;
|
||||
}
|
||||
@@ -56,7 +54,7 @@ public class HelpCommand extends BukkitCommand {
|
||||
pageNumber = 1;
|
||||
}
|
||||
} else {
|
||||
command = StringUtils.join(args, " ");
|
||||
command = Joiner.on(" ").join(args);
|
||||
pageNumber = 1;
|
||||
}
|
||||
|
||||
@@ -114,9 +112,9 @@ public class HelpCommand extends BukkitCommand {
|
||||
@NotNull
|
||||
@Override
|
||||
public List<String> tabComplete(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) {
|
||||
Validate.notNull(sender, "Sender cannot be null");
|
||||
Validate.notNull(args, "Arguments cannot be null");
|
||||
Validate.notNull(alias, "Alias cannot be null");
|
||||
Preconditions.checkArgument(sender != null, "Sender cannot be null");
|
||||
Preconditions.checkArgument(args != null, "Arguments cannot be null");
|
||||
Preconditions.checkArgument(alias != null, "Alias cannot be null");
|
||||
|
||||
if (args.length == 1) {
|
||||
List<String> matchedTopics = new ArrayList<String>();
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package org.bukkit.command.defaults;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.PrintStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.apache.commons.lang.Validate;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@@ -113,9 +113,9 @@ public class TimingsCommand extends BukkitCommand {
|
||||
@NotNull
|
||||
@Override
|
||||
public List<String> tabComplete(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) {
|
||||
Validate.notNull(sender, "Sender cannot be null");
|
||||
Validate.notNull(args, "Arguments cannot be null");
|
||||
Validate.notNull(alias, "Alias cannot be null");
|
||||
Preconditions.checkArgument(sender != null, "Sender cannot be null");
|
||||
Preconditions.checkArgument(args != null, "Arguments cannot be null");
|
||||
Preconditions.checkArgument(alias != null, "Alias cannot be null");
|
||||
|
||||
if (args.length == 1) {
|
||||
return StringUtil.copyPartialMatches(args[0], TIMINGS_SUBCOMMANDS, new ArrayList<String>(TIMINGS_SUBCOMMANDS.size()));
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.bukkit.command.defaults;
|
||||
|
||||
import com.google.common.base.Charsets;
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.io.Resources;
|
||||
import com.google.gson.Gson;
|
||||
@@ -16,7 +17,6 @@ import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
import org.apache.commons.lang.Validate;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@@ -127,9 +127,9 @@ public class VersionCommand extends BukkitCommand {
|
||||
@NotNull
|
||||
@Override
|
||||
public List<String> tabComplete(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) {
|
||||
Validate.notNull(sender, "Sender cannot be null");
|
||||
Validate.notNull(args, "Arguments cannot be null");
|
||||
Validate.notNull(alias, "Alias cannot be null");
|
||||
Preconditions.checkArgument(sender != null, "Sender cannot be null");
|
||||
Preconditions.checkArgument(args != null, "Arguments cannot be null");
|
||||
Preconditions.checkArgument(alias != null, "Alias cannot be null");
|
||||
|
||||
if (args.length == 1) {
|
||||
List<String> completions = new ArrayList<String>();
|
||||
|
||||
Reference in New Issue
Block a user