Fix import order
This commit is contained in:
parent
dbf5af7202
commit
708d11854e
275 changed files with 559 additions and 834 deletions
|
|
@ -26,11 +26,10 @@ package cloud.commandframework.brigadier;
|
|||
import cloud.commandframework.arguments.parser.ArgumentParser;
|
||||
import com.mojang.brigadier.arguments.ArgumentType;
|
||||
import com.mojang.brigadier.suggestion.SuggestionProvider;
|
||||
import java.util.function.Function;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.function.Function;
|
||||
|
||||
import static java.util.Objects.requireNonNull;
|
||||
|
||||
final class BrigadierMapping<C, K extends ArgumentParser<C, ?>, S> {
|
||||
|
|
|
|||
|
|
@ -26,11 +26,10 @@ package cloud.commandframework.brigadier;
|
|||
import cloud.commandframework.arguments.parser.ArgumentParser;
|
||||
import com.mojang.brigadier.arguments.ArgumentType;
|
||||
import com.mojang.brigadier.suggestion.SuggestionProvider;
|
||||
import java.util.function.Function;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.function.Function;
|
||||
|
||||
import static java.util.Objects.requireNonNull;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -63,9 +63,6 @@ import com.mojang.brigadier.suggestion.SuggestionsBuilder;
|
|||
import com.mojang.brigadier.tree.LiteralCommandNode;
|
||||
import io.leangen.geantyref.GenericTypeReflector;
|
||||
import io.leangen.geantyref.TypeToken;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
|
@ -78,6 +75,8 @@ import java.util.function.Function;
|
|||
import java.util.function.Supplier;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
/**
|
||||
* Manager used to map cloud {@link Command}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@
|
|||
package cloud.commandframework.brigadier.argument;
|
||||
|
||||
import com.mojang.brigadier.StringReader;
|
||||
|
||||
import java.util.Deque;
|
||||
import java.util.Queue;
|
||||
|
||||
|
|
|
|||
|
|
@ -24,14 +24,13 @@
|
|||
package cloud.commandframework.brigadier.argument;
|
||||
|
||||
import com.mojang.brigadier.StringReader;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
import java.util.NoSuchElementException;
|
||||
import java.util.Queue;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
/**
|
||||
* An interface combining {@link Queue} behaviour with a Brigadier {@link StringReader}.
|
||||
|
|
|
|||
|
|
@ -24,10 +24,9 @@
|
|||
package cloud.commandframework.brigadier.argument;
|
||||
|
||||
import com.mojang.brigadier.StringReader;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Queue;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
/**
|
||||
* A wrapper around Mojang's {@link StringReader} that implements the {@link Queue} interface.
|
||||
|
|
|
|||
|
|
@ -33,13 +33,12 @@ import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
|||
import com.mojang.brigadier.suggestion.Suggestion;
|
||||
import com.mojang.brigadier.suggestion.Suggestions;
|
||||
import com.mojang.brigadier.suggestion.SuggestionsBuilder;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Queue;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import static java.util.Objects.requireNonNull;
|
||||
|
||||
|
|
|
|||
|
|
@ -24,11 +24,10 @@
|
|||
package cloud.commandframework.brigadier.argument;
|
||||
|
||||
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.LinkedList;
|
||||
import java.util.Queue;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
|
|
|||
|
|
@ -25,12 +25,11 @@ package cloud.commandframework.brigadier.argument;
|
|||
|
||||
import cloud.commandframework.types.tuples.Pair;
|
||||
import com.mojang.brigadier.StringReader;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.NoSuchElementException;
|
||||
import java.util.Queue;
|
||||
import java.util.stream.Stream;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
|
|
|||
|
|
@ -41,12 +41,11 @@ import com.mojang.brigadier.arguments.ArgumentType;
|
|||
import com.mojang.brigadier.arguments.StringArgumentType;
|
||||
import io.leangen.geantyref.GenericTypeReflector;
|
||||
import io.leangen.geantyref.TypeToken;
|
||||
import org.bukkit.NamespacedKey;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.util.function.Supplier;
|
||||
import java.util.logging.Level;
|
||||
import org.bukkit.NamespacedKey;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
/**
|
||||
* Class which handles mapping argument types to their NMS Brigadier counterpart on Bukkit platforms.
|
||||
|
|
|
|||
|
|
@ -24,11 +24,10 @@
|
|||
package cloud.commandframework.bukkit;
|
||||
|
||||
import cloud.commandframework.captions.Caption;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedList;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
/**
|
||||
* {@link Caption} instances for messages in cloud-bukkit
|
||||
|
|
|
|||
|
|
@ -35,17 +35,16 @@ import cloud.commandframework.exceptions.NoSuchCommandException;
|
|||
import cloud.commandframework.meta.CommandMeta;
|
||||
import cloud.commandframework.permission.CommandPermission;
|
||||
import cloud.commandframework.permission.Permission;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CompletionException;
|
||||
import java.util.logging.Level;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.PluginIdentifiableCommand;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CompletionException;
|
||||
import java.util.logging.Level;
|
||||
|
||||
final class BukkitCommand<C> extends org.bukkit.command.Command implements PluginIdentifiableCommand {
|
||||
|
||||
private static final String MESSAGE_INTERNAL_ERROR = ChatColor.RED
|
||||
|
|
|
|||
|
|
@ -26,9 +26,8 @@ package cloud.commandframework.bukkit;
|
|||
import cloud.commandframework.keys.CloudKey;
|
||||
import cloud.commandframework.keys.SimpleCloudKey;
|
||||
import io.leangen.geantyref.TypeToken;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
import java.util.Set;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
/**
|
||||
* Bukkit related {@link cloud.commandframework.context.CommandContext} keys.
|
||||
|
|
|
|||
|
|
@ -51,6 +51,10 @@ import cloud.commandframework.execution.CommandExecutionCoordinator;
|
|||
import cloud.commandframework.tasks.TaskFactory;
|
||||
import cloud.commandframework.tasks.TaskRecipe;
|
||||
import io.leangen.geantyref.TypeToken;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Set;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.UnaryOperator;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
|
|
@ -62,11 +66,6 @@ import org.bukkit.plugin.Plugin;
|
|||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Set;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.UnaryOperator;
|
||||
|
||||
/**
|
||||
* Command manager for the Bukkit platform
|
||||
*
|
||||
|
|
|
|||
|
|
@ -27,11 +27,10 @@ import cloud.commandframework.brigadier.argument.WrappedBrigadierParser;
|
|||
import cloud.commandframework.bukkit.internal.BukkitBackwardsBrigadierSenderMapper;
|
||||
import cloud.commandframework.execution.preprocessor.CommandPreprocessingContext;
|
||||
import cloud.commandframework.execution.preprocessor.CommandPreprocessor;
|
||||
import java.util.Set;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* Command preprocessor which decorates incoming {@link cloud.commandframework.context.CommandContext}
|
||||
* with Bukkit specific objects
|
||||
|
|
|
|||
|
|
@ -28,13 +28,6 @@ import cloud.commandframework.CommandManager;
|
|||
import cloud.commandframework.arguments.CommandArgument;
|
||||
import cloud.commandframework.arguments.StaticArgument;
|
||||
import cloud.commandframework.internal.CommandRegistrationHandler;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.CommandMap;
|
||||
import org.bukkit.command.PluginIdentifiableCommand;
|
||||
import org.bukkit.command.SimpleCommandMap;
|
||||
import org.bukkit.help.GenericCommandHelpTopic;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
|
|
@ -44,6 +37,12 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.TreeSet;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.CommandMap;
|
||||
import org.bukkit.command.PluginIdentifiableCommand;
|
||||
import org.bukkit.command.SimpleCommandMap;
|
||||
import org.bukkit.help.GenericCommandHelpTopic;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
public class BukkitPluginRegistrationHandler<C> implements CommandRegistrationHandler {
|
||||
|
||||
|
|
|
|||
|
|
@ -26,11 +26,10 @@ package cloud.commandframework.bukkit;
|
|||
import cloud.commandframework.tasks.TaskConsumer;
|
||||
import cloud.commandframework.tasks.TaskFunction;
|
||||
import cloud.commandframework.tasks.TaskSynchronizer;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
/**
|
||||
* {@link TaskSynchronizer} using Bukkit's {@link org.bukkit.scheduler.BukkitScheduler}
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@
|
|||
package cloud.commandframework.bukkit;
|
||||
|
||||
import cloud.commandframework.bukkit.internal.CraftBukkitReflection;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ import cloud.commandframework.bukkit.internal.BukkitBackwardsBrigadierSenderMapp
|
|||
import cloud.commandframework.context.CommandContext;
|
||||
import com.mojang.brigadier.tree.CommandNode;
|
||||
import com.mojang.brigadier.tree.LiteralCommandNode;
|
||||
import java.util.Collections;
|
||||
import me.lucko.commodore.Commodore;
|
||||
import me.lucko.commodore.CommodoreProvider;
|
||||
import org.bukkit.Bukkit;
|
||||
|
|
@ -36,8 +37,6 @@ import org.bukkit.command.CommandSender;
|
|||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||
class CloudCommodoreManager<C> extends BukkitPluginRegistrationHandler<C> {
|
||||
|
||||
|
|
|
|||
|
|
@ -23,11 +23,10 @@
|
|||
//
|
||||
package cloud.commandframework.bukkit.arguments.selector;
|
||||
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
/**
|
||||
* A class to represent the result of parsing a Minecraft Entity/Target Selector argument
|
||||
|
|
|
|||
|
|
@ -23,11 +23,10 @@
|
|||
//
|
||||
package cloud.commandframework.bukkit.arguments.selector;
|
||||
|
||||
import java.util.List;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class MultipleEntitySelector extends EntitySelector {
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -23,15 +23,14 @@
|
|||
//
|
||||
package cloud.commandframework.bukkit.arguments.selector;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class MultiplePlayerSelector extends MultipleEntitySelector {
|
||||
|
||||
private final List<Player> players = new ArrayList<>();
|
||||
|
|
|
|||
|
|
@ -23,12 +23,11 @@
|
|||
//
|
||||
package cloud.commandframework.bukkit.arguments.selector;
|
||||
|
||||
import java.util.List;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public final class SingleEntitySelector extends MultipleEntitySelector {
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -23,13 +23,12 @@
|
|||
//
|
||||
package cloud.commandframework.bukkit.arguments.selector;
|
||||
|
||||
import java.util.List;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public final class SinglePlayerSelector extends MultiplePlayerSelector {
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -23,12 +23,11 @@
|
|||
//
|
||||
package cloud.commandframework.bukkit.data;
|
||||
|
||||
import java.util.function.Predicate;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Block;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import java.util.function.Predicate;
|
||||
|
||||
/**
|
||||
* A {@link Predicate} for {@link Block Blocks} in a {@link World}, parsed from user input.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -23,9 +23,8 @@
|
|||
//
|
||||
package cloud.commandframework.bukkit.data;
|
||||
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import java.util.function.Predicate;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
/**
|
||||
* {@link Predicate} for {@link ItemStack ItemStacks}, parsed from user input.
|
||||
|
|
|
|||
|
|
@ -25,11 +25,10 @@ package cloud.commandframework.bukkit.internal;
|
|||
|
||||
import cloud.commandframework.bukkit.BukkitCommandManager;
|
||||
import com.google.common.annotations.Beta;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.function.Function;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
/**
|
||||
* This is not API, and as such, may break, change, or be removed without any notice.
|
||||
|
|
|
|||
|
|
@ -24,16 +24,15 @@
|
|||
package cloud.commandframework.bukkit.internal;
|
||||
|
||||
import com.google.common.annotations.Beta;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Arrays;
|
||||
import java.util.function.Supplier;
|
||||
import java.util.stream.Stream;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
/**
|
||||
* Utilities for doing reflection on CraftBukkit, used by the cloud implementation.
|
||||
|
|
|
|||
|
|
@ -49,13 +49,12 @@ package cloud.commandframework.bukkit.internal;
|
|||
|
||||
import com.google.common.annotations.Beta;
|
||||
import com.mojang.brigadier.arguments.ArgumentType;
|
||||
import org.bukkit.NamespacedKey;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Arrays;
|
||||
import org.bukkit.NamespacedKey;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
/**
|
||||
* A registry of the {@link ArgumentType}s provided by Minecraft.
|
||||
|
|
|
|||
|
|
@ -35,17 +35,16 @@ import cloud.commandframework.bukkit.internal.MinecraftArgumentTypes;
|
|||
import cloud.commandframework.context.CommandContext;
|
||||
import com.mojang.brigadier.arguments.ArgumentType;
|
||||
import io.leangen.geantyref.TypeToken;
|
||||
import org.bukkit.NamespacedKey;
|
||||
import org.bukkit.block.Block;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.List;
|
||||
import java.util.Queue;
|
||||
import java.util.function.BiFunction;
|
||||
import java.util.function.Predicate;
|
||||
import org.bukkit.NamespacedKey;
|
||||
import org.bukkit.block.Block;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
/**
|
||||
* Argument type for parsing a {@link BlockPredicate}.
|
||||
|
|
|
|||
|
|
@ -32,15 +32,14 @@ import cloud.commandframework.captions.CaptionVariable;
|
|||
import cloud.commandframework.context.CommandContext;
|
||||
import cloud.commandframework.exceptions.parsing.NoInputProvidedException;
|
||||
import cloud.commandframework.exceptions.parsing.ParserException;
|
||||
import org.bukkit.NamespacedKey;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Queue;
|
||||
import java.util.function.BiFunction;
|
||||
import org.bukkit.NamespacedKey;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
/**
|
||||
* cloud argument type that parses Bukkit {@link Enchantment enchantments}
|
||||
|
|
|
|||
|
|
@ -35,12 +35,6 @@ import cloud.commandframework.bukkit.internal.MinecraftArgumentTypes;
|
|||
import cloud.commandframework.context.CommandContext;
|
||||
import com.mojang.brigadier.arguments.ArgumentType;
|
||||
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.NamespacedKey;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
|
|
@ -50,6 +44,11 @@ import java.util.Locale;
|
|||
import java.util.Queue;
|
||||
import java.util.function.BiFunction;
|
||||
import java.util.stream.Collectors;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.NamespacedKey;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import static java.util.Objects.requireNonNull;
|
||||
|
||||
|
|
|
|||
|
|
@ -36,17 +36,16 @@ import cloud.commandframework.context.CommandContext;
|
|||
import com.mojang.brigadier.arguments.ArgumentType;
|
||||
import com.mojang.brigadier.context.StringRange;
|
||||
import io.leangen.geantyref.TypeToken;
|
||||
import org.bukkit.NamespacedKey;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Queue;
|
||||
import java.util.function.BiFunction;
|
||||
import java.util.function.Predicate;
|
||||
import org.bukkit.NamespacedKey;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
/**
|
||||
* Argument type for parsing an {@link ItemStackPredicate}.
|
||||
|
|
|
|||
|
|
@ -32,14 +32,13 @@ import cloud.commandframework.captions.CaptionVariable;
|
|||
import cloud.commandframework.context.CommandContext;
|
||||
import cloud.commandframework.exceptions.parsing.NoInputProvidedException;
|
||||
import cloud.commandframework.exceptions.parsing.ParserException;
|
||||
import org.bukkit.Material;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Queue;
|
||||
import java.util.function.BiFunction;
|
||||
import org.bukkit.Material;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
/**
|
||||
* cloud argument type that parses Bukkit {@link Material materials}
|
||||
|
|
|
|||
|
|
@ -33,6 +33,10 @@ import cloud.commandframework.captions.CaptionVariable;
|
|||
import cloud.commandframework.context.CommandContext;
|
||||
import cloud.commandframework.exceptions.parsing.NoInputProvidedException;
|
||||
import cloud.commandframework.exceptions.parsing.ParserException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Queue;
|
||||
import java.util.function.BiFunction;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
|
@ -40,11 +44,6 @@ import org.bukkit.entity.Player;
|
|||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Queue;
|
||||
import java.util.function.BiFunction;
|
||||
|
||||
/**
|
||||
* Argument type that parses into {@link OfflinePlayer}. This is not thread safe. This
|
||||
* may also result in a blocking request to get the UUID for the offline player.
|
||||
|
|
|
|||
|
|
@ -33,17 +33,16 @@ import cloud.commandframework.captions.CaptionVariable;
|
|||
import cloud.commandframework.context.CommandContext;
|
||||
import cloud.commandframework.exceptions.parsing.NoInputProvidedException;
|
||||
import cloud.commandframework.exceptions.parsing.ParserException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Queue;
|
||||
import java.util.function.BiFunction;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Queue;
|
||||
import java.util.function.BiFunction;
|
||||
|
||||
/**
|
||||
* Argument that parses into a {@link Player}
|
||||
*
|
||||
|
|
|
|||
|
|
@ -32,15 +32,14 @@ import cloud.commandframework.captions.CaptionVariable;
|
|||
import cloud.commandframework.context.CommandContext;
|
||||
import cloud.commandframework.exceptions.parsing.NoInputProvidedException;
|
||||
import cloud.commandframework.exceptions.parsing.ParserException;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.World;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Queue;
|
||||
import java.util.function.BiFunction;
|
||||
import java.util.stream.Collectors;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.World;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
/**
|
||||
* cloud argument type that parses Bukkit {@link org.bukkit.World worlds}
|
||||
|
|
|
|||
|
|
@ -31,6 +31,11 @@ import cloud.commandframework.bukkit.BukkitCommandContextKeys;
|
|||
import cloud.commandframework.bukkit.parsers.location.LocationArgument.LocationParseException;
|
||||
import cloud.commandframework.context.CommandContext;
|
||||
import io.leangen.geantyref.TypeToken;
|
||||
import java.util.Collection;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Queue;
|
||||
import java.util.function.BiFunction;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.command.BlockCommandSender;
|
||||
|
|
@ -40,12 +45,6 @@ import org.bukkit.util.Vector;
|
|||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Queue;
|
||||
import java.util.function.BiFunction;
|
||||
|
||||
/**
|
||||
* Argument parser that parses {@link Location2D} from two doubles. This will use the command
|
||||
* senders world when it exists, or else it'll use the first loaded Bukkit world
|
||||
|
|
|
|||
|
|
@ -35,6 +35,12 @@ import cloud.commandframework.captions.CaptionVariable;
|
|||
import cloud.commandframework.context.CommandContext;
|
||||
import cloud.commandframework.exceptions.parsing.ParserException;
|
||||
import io.leangen.geantyref.TypeToken;
|
||||
import java.util.Collection;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Queue;
|
||||
import java.util.function.BiFunction;
|
||||
import java.util.stream.Collectors;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.command.BlockCommandSender;
|
||||
|
|
@ -44,13 +50,6 @@ import org.bukkit.util.Vector;
|
|||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Queue;
|
||||
import java.util.function.BiFunction;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* Argument parser that parses {@link Location} from three doubles. This will use the command
|
||||
* senders world when it exists, or else it'll use the first loaded Bukkit world
|
||||
|
|
|
|||
|
|
@ -23,9 +23,8 @@
|
|||
//
|
||||
package cloud.commandframework.bukkit.parsers.location;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import java.util.Objects;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
/**
|
||||
* Single coordinate with a type
|
||||
|
|
|
|||
|
|
@ -29,9 +29,8 @@ import cloud.commandframework.arguments.standard.DoubleArgument;
|
|||
import cloud.commandframework.bukkit.parsers.PlayerArgument;
|
||||
import cloud.commandframework.context.CommandContext;
|
||||
import cloud.commandframework.exceptions.parsing.NoInputProvidedException;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import java.util.Queue;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
/**
|
||||
* A single coordinate, meant to be used as an element in a position vector
|
||||
|
|
|
|||
|
|
@ -32,15 +32,14 @@ import cloud.commandframework.bukkit.CloudBukkitCapabilities;
|
|||
import cloud.commandframework.bukkit.arguments.selector.MultipleEntitySelector;
|
||||
import cloud.commandframework.context.CommandContext;
|
||||
import cloud.commandframework.exceptions.parsing.NoInputProvidedException;
|
||||
import java.util.List;
|
||||
import java.util.Queue;
|
||||
import java.util.function.BiFunction;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Queue;
|
||||
import java.util.function.BiFunction;
|
||||
|
||||
public final class MultipleEntitySelectorArgument<C> extends CommandArgument<C, MultipleEntitySelector> {
|
||||
|
||||
private MultipleEntitySelectorArgument(
|
||||
|
|
|
|||
|
|
@ -34,6 +34,10 @@ import cloud.commandframework.bukkit.parsers.PlayerArgument;
|
|||
import cloud.commandframework.context.CommandContext;
|
||||
import cloud.commandframework.exceptions.parsing.NoInputProvidedException;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Queue;
|
||||
import java.util.function.BiFunction;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Entity;
|
||||
|
|
@ -41,11 +45,6 @@ import org.bukkit.entity.Player;
|
|||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Queue;
|
||||
import java.util.function.BiFunction;
|
||||
|
||||
public final class MultiplePlayerSelectorArgument<C> extends CommandArgument<C, MultiplePlayerSelector> {
|
||||
|
||||
private MultiplePlayerSelectorArgument(
|
||||
|
|
|
|||
|
|
@ -32,15 +32,14 @@ import cloud.commandframework.bukkit.CloudBukkitCapabilities;
|
|||
import cloud.commandframework.bukkit.arguments.selector.SingleEntitySelector;
|
||||
import cloud.commandframework.context.CommandContext;
|
||||
import cloud.commandframework.exceptions.parsing.NoInputProvidedException;
|
||||
import java.util.List;
|
||||
import java.util.Queue;
|
||||
import java.util.function.BiFunction;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Queue;
|
||||
import java.util.function.BiFunction;
|
||||
|
||||
public final class SingleEntitySelectorArgument<C> extends CommandArgument<C, SingleEntitySelector> {
|
||||
|
||||
private SingleEntitySelectorArgument(
|
||||
|
|
|
|||
|
|
@ -34,6 +34,10 @@ import cloud.commandframework.bukkit.parsers.PlayerArgument;
|
|||
import cloud.commandframework.context.CommandContext;
|
||||
import cloud.commandframework.exceptions.parsing.NoInputProvidedException;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Queue;
|
||||
import java.util.function.BiFunction;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Entity;
|
||||
|
|
@ -41,11 +45,6 @@ import org.bukkit.entity.Player;
|
|||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Queue;
|
||||
import java.util.function.BiFunction;
|
||||
|
||||
public final class SinglePlayerSelectorArgument<C> extends CommandArgument<C, SinglePlayerSelector> {
|
||||
|
||||
private SinglePlayerSelectorArgument(
|
||||
|
|
|
|||
|
|
@ -24,11 +24,10 @@
|
|||
package cloud.commandframework.bungee;
|
||||
|
||||
import cloud.commandframework.captions.Caption;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedList;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
/**
|
||||
* Bungee specific {@link Caption caption keys}
|
||||
|
|
|
|||
|
|
@ -31,6 +31,8 @@ import cloud.commandframework.exceptions.InvalidCommandSenderException;
|
|||
import cloud.commandframework.exceptions.InvalidSyntaxException;
|
||||
import cloud.commandframework.exceptions.NoPermissionException;
|
||||
import cloud.commandframework.exceptions.NoSuchCommandException;
|
||||
import java.util.concurrent.CompletionException;
|
||||
import java.util.logging.Level;
|
||||
import net.md_5.bungee.api.ChatColor;
|
||||
import net.md_5.bungee.api.CommandSender;
|
||||
import net.md_5.bungee.api.chat.ComponentBuilder;
|
||||
|
|
@ -38,9 +40,6 @@ import net.md_5.bungee.api.plugin.Command;
|
|||
import net.md_5.bungee.api.plugin.TabExecutor;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import java.util.concurrent.CompletionException;
|
||||
import java.util.logging.Level;
|
||||
|
||||
public final class BungeeCommand<C> extends Command implements TabExecutor {
|
||||
|
||||
private static final String MESSAGE_INTERNAL_ERROR = "An internal error occurred while attempting to perform this command.";
|
||||
|
|
|
|||
|
|
@ -31,14 +31,13 @@ import cloud.commandframework.captions.FactoryDelegatingCaptionRegistry;
|
|||
import cloud.commandframework.execution.CommandExecutionCoordinator;
|
||||
import cloud.commandframework.meta.SimpleCommandMeta;
|
||||
import io.leangen.geantyref.TypeToken;
|
||||
import java.util.function.Function;
|
||||
import net.md_5.bungee.api.CommandSender;
|
||||
import net.md_5.bungee.api.config.ServerInfo;
|
||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||
import net.md_5.bungee.api.plugin.Plugin;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import java.util.function.Function;
|
||||
|
||||
public class BungeeCommandManager<C> extends CommandManager<C> {
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -26,10 +26,9 @@ package cloud.commandframework.bungee;
|
|||
import cloud.commandframework.Command;
|
||||
import cloud.commandframework.arguments.CommandArgument;
|
||||
import cloud.commandframework.internal.CommandRegistrationHandler;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
final class BungeePluginRegistrationHandler<C> implements CommandRegistrationHandler {
|
||||
|
||||
|
|
|
|||
|
|
@ -33,17 +33,16 @@ import cloud.commandframework.context.CommandContext;
|
|||
import cloud.commandframework.exceptions.parsing.NoInputProvidedException;
|
||||
import cloud.commandframework.exceptions.parsing.ParserException;
|
||||
import io.leangen.geantyref.TypeToken;
|
||||
import net.md_5.bungee.api.ProxyServer;
|
||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Queue;
|
||||
import java.util.function.BiFunction;
|
||||
import java.util.stream.Collectors;
|
||||
import net.md_5.bungee.api.ProxyServer;
|
||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
/**
|
||||
* Argument parser for {@link ProxiedPlayer players}
|
||||
|
|
|
|||
|
|
@ -33,17 +33,16 @@ import cloud.commandframework.context.CommandContext;
|
|||
import cloud.commandframework.exceptions.parsing.NoInputProvidedException;
|
||||
import cloud.commandframework.exceptions.parsing.ParserException;
|
||||
import io.leangen.geantyref.TypeToken;
|
||||
import net.md_5.bungee.api.ProxyServer;
|
||||
import net.md_5.bungee.api.config.ServerInfo;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Queue;
|
||||
import java.util.function.BiFunction;
|
||||
import net.md_5.bungee.api.ProxyServer;
|
||||
import net.md_5.bungee.api.config.ServerInfo;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
/**
|
||||
* Argument parser for {@link net.md_5.bungee.api.config.ServerInfo servers}
|
||||
|
|
|
|||
|
|
@ -32,15 +32,14 @@ import cloud.commandframework.exceptions.InvalidSyntaxException;
|
|||
import cloud.commandframework.exceptions.NoPermissionException;
|
||||
import cloud.commandframework.exceptions.NoSuchCommandException;
|
||||
import cloud.commandframework.meta.CommandMeta;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CompletionException;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.cloudburstmc.server.command.CommandSender;
|
||||
import org.cloudburstmc.server.command.PluginCommand;
|
||||
import org.cloudburstmc.server.command.data.CommandData;
|
||||
import org.cloudburstmc.server.plugin.Plugin;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CompletionException;
|
||||
|
||||
final class CloudburstCommand<C> extends PluginCommand<Plugin> {
|
||||
|
||||
private static final String MESSAGE_INTERNAL_ERROR = "An internal error occurred while attempting to perform this command.";
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ import cloud.commandframework.CommandTree;
|
|||
import cloud.commandframework.execution.CommandExecutionCoordinator;
|
||||
import cloud.commandframework.meta.CommandMeta;
|
||||
import cloud.commandframework.meta.SimpleCommandMeta;
|
||||
import java.util.function.Function;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.cloudburstmc.server.command.CommandSender;
|
||||
import org.cloudburstmc.server.event.EventPriority;
|
||||
|
|
@ -35,8 +36,6 @@ import org.cloudburstmc.server.event.Listener;
|
|||
import org.cloudburstmc.server.event.server.RegistriesClosedEvent;
|
||||
import org.cloudburstmc.server.plugin.Plugin;
|
||||
|
||||
import java.util.function.Function;
|
||||
|
||||
/**
|
||||
* Command manager for the Cloudburst platform
|
||||
*
|
||||
|
|
|
|||
|
|
@ -27,13 +27,12 @@ import cloud.commandframework.Command;
|
|||
import cloud.commandframework.arguments.CommandArgument;
|
||||
import cloud.commandframework.arguments.StaticArgument;
|
||||
import cloud.commandframework.internal.CommandRegistrationHandler;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.cloudburstmc.server.Server;
|
||||
import org.cloudburstmc.server.plugin.Plugin;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
class CloudburstPluginRegistrationHandler<C> implements CommandRegistrationHandler {
|
||||
|
||||
private final Map<CommandArgument<?, ?>, org.cloudburstmc.server.command.Command> registeredCommands = new HashMap<>();
|
||||
|
|
|
|||
|
|
@ -24,11 +24,10 @@
|
|||
package cloud.commandframework.fabric;
|
||||
|
||||
import cloud.commandframework.captions.Caption;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
/**
|
||||
* {@link Caption} instances for messages in cloud-fabric
|
||||
|
|
|
|||
|
|
@ -27,14 +27,13 @@ import cloud.commandframework.CommandTree;
|
|||
import cloud.commandframework.execution.AsynchronousCommandExecutionCoordinator;
|
||||
import cloud.commandframework.execution.CommandExecutionCoordinator;
|
||||
import cloud.commandframework.permission.PredicatePermission;
|
||||
import java.util.function.Function;
|
||||
import net.fabricmc.fabric.api.client.command.v1.FabricClientCommandSource;
|
||||
import net.fabricmc.fabric.api.command.v1.CommandRegistrationCallback;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.multiplayer.ClientSuggestionProvider;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import java.util.function.Function;
|
||||
|
||||
/**
|
||||
* A command manager for registering client-side commands.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -44,6 +44,16 @@ import com.mojang.brigadier.suggestion.SuggestionProvider;
|
|||
import com.mojang.serialization.Codec;
|
||||
import io.leangen.geantyref.GenericTypeReflector;
|
||||
import io.leangen.geantyref.TypeToken;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.lang.reflect.ParameterizedType;
|
||||
import java.lang.reflect.Type;
|
||||
import java.lang.reflect.WildcardType;
|
||||
import java.util.EnumSet;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Supplier;
|
||||
import net.minecraft.ChatFormatting;
|
||||
import net.minecraft.advancements.critereon.MinMaxBounds;
|
||||
import net.minecraft.commands.SharedSuggestionProvider;
|
||||
|
|
@ -82,17 +92,6 @@ import org.apache.logging.log4j.LogManager;
|
|||
import org.apache.logging.log4j.Logger;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.lang.reflect.ParameterizedType;
|
||||
import java.lang.reflect.Type;
|
||||
import java.lang.reflect.WildcardType;
|
||||
import java.util.EnumSet;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
/**
|
||||
* A command manager for either the server or client on Fabric.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -31,6 +31,8 @@ import com.mojang.brigadier.builder.LiteralArgumentBuilder;
|
|||
import com.mojang.brigadier.tree.CommandNode;
|
||||
import com.mojang.brigadier.tree.LiteralCommandNode;
|
||||
import com.mojang.brigadier.tree.RootCommandNode;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import net.fabricmc.fabric.api.client.command.v1.ClientCommandManager;
|
||||
import net.fabricmc.fabric.api.client.command.v1.FabricClientCommandSource;
|
||||
import net.fabricmc.fabric.api.command.v1.CommandRegistrationCallback;
|
||||
|
|
@ -40,9 +42,6 @@ import net.minecraft.commands.SharedSuggestionProvider;
|
|||
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
/**
|
||||
* A registration handler for Fabric API.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -32,6 +32,11 @@ import cloud.commandframework.exceptions.NoSuchCommandException;
|
|||
import com.mojang.brigadier.Command;
|
||||
import com.mojang.brigadier.context.CommandContext;
|
||||
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.StringWriter;
|
||||
import java.util.concurrent.CompletionException;
|
||||
import java.util.function.BiConsumer;
|
||||
import java.util.function.Function;
|
||||
import net.minecraft.ChatFormatting;
|
||||
import net.minecraft.commands.SharedSuggestionProvider;
|
||||
import net.minecraft.network.chat.ClickEvent;
|
||||
|
|
@ -44,12 +49,6 @@ import org.apache.logging.log4j.LogManager;
|
|||
import org.apache.logging.log4j.Logger;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
import java.io.StringWriter;
|
||||
import java.util.concurrent.CompletionException;
|
||||
import java.util.function.BiConsumer;
|
||||
import java.util.function.Function;
|
||||
|
||||
final class FabricExecutor<C, S extends SharedSuggestionProvider> implements Command<S> {
|
||||
|
||||
private static final Logger LOGGER = LogManager.getLogger();
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ import cloud.commandframework.fabric.data.SinglePlayerSelector;
|
|||
import cloud.commandframework.fabric.internal.LateRegistrationCatcher;
|
||||
import cloud.commandframework.meta.CommandMeta;
|
||||
import io.leangen.geantyref.TypeToken;
|
||||
import java.util.function.Function;
|
||||
import me.lucko.fabric.api.permissions.v0.Permissions;
|
||||
import net.fabricmc.fabric.api.command.v1.CommandRegistrationCallback;
|
||||
import net.minecraft.commands.CommandSource;
|
||||
|
|
@ -48,8 +49,6 @@ import net.minecraft.world.phys.Vec2;
|
|||
import net.minecraft.world.phys.Vec3;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import java.util.function.Function;
|
||||
|
||||
/**
|
||||
* A command manager for registering server-side commands.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@ package cloud.commandframework.fabric.annotations.specifier;
|
|||
|
||||
import cloud.commandframework.fabric.argument.server.Vec2dArgument;
|
||||
import cloud.commandframework.fabric.argument.server.Vec3dArgument;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
|
|
|
|||
|
|
@ -27,11 +27,10 @@ import cloud.commandframework.ArgumentDescription;
|
|||
import cloud.commandframework.arguments.CommandArgument;
|
||||
import cloud.commandframework.brigadier.argument.WrappedBrigadierParser;
|
||||
import cloud.commandframework.context.CommandContext;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.function.BiFunction;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
/**
|
||||
* An argument for an angle, specified in degrees.
|
||||
|
|
|
|||
|
|
@ -28,15 +28,14 @@ import cloud.commandframework.arguments.CommandArgument;
|
|||
import cloud.commandframework.brigadier.argument.WrappedBrigadierParser;
|
||||
import cloud.commandframework.context.CommandContext;
|
||||
import io.leangen.geantyref.TypeToken;
|
||||
import net.minecraft.commands.arguments.coordinates.SwizzleArgument;
|
||||
import net.minecraft.core.Direction;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.function.BiFunction;
|
||||
import net.minecraft.commands.arguments.coordinates.SwizzleArgument;
|
||||
import net.minecraft.core.Direction;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
/**
|
||||
* An argument for a set of {@link net.minecraft.core.Direction.Axis axes}, described in Vanilla as a "swizzle".
|
||||
|
|
|
|||
|
|
@ -27,13 +27,12 @@ import cloud.commandframework.ArgumentDescription;
|
|||
import cloud.commandframework.arguments.CommandArgument;
|
||||
import cloud.commandframework.brigadier.argument.WrappedBrigadierParser;
|
||||
import cloud.commandframework.context.CommandContext;
|
||||
import java.util.List;
|
||||
import java.util.function.BiFunction;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.function.BiFunction;
|
||||
|
||||
/**
|
||||
* An argument for the string representation of an NBT {@link CompoundTag}.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -27,11 +27,10 @@ import cloud.commandframework.ArgumentDescription;
|
|||
import cloud.commandframework.arguments.CommandArgument;
|
||||
import cloud.commandframework.brigadier.argument.WrappedBrigadierParser;
|
||||
import cloud.commandframework.context.CommandContext;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.function.BiFunction;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
/**
|
||||
* An argument parsing an {@link net.minecraft.commands.arguments.EntityAnchorArgument.Anchor}.
|
||||
|
|
|
|||
|
|
@ -39,6 +39,10 @@ import cloud.commandframework.fabric.internal.EntitySelectorAccess;
|
|||
import cloud.commandframework.fabric.mixin.MessageArgumentMessageAccess;
|
||||
import cloud.commandframework.fabric.mixin.MessageArgumentPartAccess;
|
||||
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.function.Function;
|
||||
import net.minecraft.commands.CommandSourceStack;
|
||||
import net.minecraft.commands.SharedSuggestionProvider;
|
||||
import net.minecraft.commands.arguments.EntityArgument;
|
||||
|
|
@ -56,11 +60,6 @@ import net.minecraft.world.entity.Entity;
|
|||
import net.minecraft.world.phys.Vec3;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.function.Function;
|
||||
|
||||
/**
|
||||
* Parsers for Vanilla command argument types.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -27,14 +27,13 @@ import cloud.commandframework.ArgumentDescription;
|
|||
import cloud.commandframework.arguments.CommandArgument;
|
||||
import cloud.commandframework.brigadier.argument.WrappedBrigadierParser;
|
||||
import cloud.commandframework.context.CommandContext;
|
||||
import java.util.List;
|
||||
import java.util.function.BiFunction;
|
||||
import net.minecraft.advancements.critereon.MinMaxBounds;
|
||||
import net.minecraft.commands.arguments.RangeArgument;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.function.BiFunction;
|
||||
|
||||
/**
|
||||
* An argument parsing an unbounded {@link net.minecraft.advancements.critereon.MinMaxBounds.Floats float range}, in the form
|
||||
* {@code [min]..[max]}, where both lower and upper bounds are optional.
|
||||
|
|
|
|||
|
|
@ -27,14 +27,13 @@ import cloud.commandframework.ArgumentDescription;
|
|||
import cloud.commandframework.arguments.CommandArgument;
|
||||
import cloud.commandframework.brigadier.argument.WrappedBrigadierParser;
|
||||
import cloud.commandframework.context.CommandContext;
|
||||
import java.util.List;
|
||||
import java.util.function.BiFunction;
|
||||
import net.minecraft.advancements.critereon.MinMaxBounds;
|
||||
import net.minecraft.commands.arguments.RangeArgument;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.function.BiFunction;
|
||||
|
||||
/**
|
||||
* An argument parsing an unbounded {@link net.minecraft.advancements.critereon.MinMaxBounds.Ints integer range}, in the form
|
||||
* {@code [min]..[max]}, where both lower and upper bounds are optional.
|
||||
|
|
|
|||
|
|
@ -27,6 +27,8 @@ import cloud.commandframework.ArgumentDescription;
|
|||
import cloud.commandframework.arguments.CommandArgument;
|
||||
import cloud.commandframework.brigadier.argument.WrappedBrigadierParser;
|
||||
import cloud.commandframework.context.CommandContext;
|
||||
import java.util.List;
|
||||
import java.util.function.BiFunction;
|
||||
import net.minecraft.commands.arguments.item.ItemArgument;
|
||||
import net.minecraft.commands.arguments.item.ItemInput;
|
||||
import net.minecraft.core.Registry;
|
||||
|
|
@ -34,9 +36,6 @@ import net.minecraft.world.item.ItemStack;
|
|||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.function.BiFunction;
|
||||
|
||||
/**
|
||||
* An argument parsing an item identifier and optional extra NBT data into an {@link ItemInput}.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -27,14 +27,13 @@ import cloud.commandframework.ArgumentDescription;
|
|||
import cloud.commandframework.arguments.CommandArgument;
|
||||
import cloud.commandframework.brigadier.argument.WrappedBrigadierParser;
|
||||
import cloud.commandframework.context.CommandContext;
|
||||
import java.util.List;
|
||||
import java.util.function.BiFunction;
|
||||
import net.minecraft.core.Registry;
|
||||
import net.minecraft.world.effect.MobEffect;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.function.BiFunction;
|
||||
|
||||
/**
|
||||
* An argument parsing a status effect from the {@link net.minecraft.core.Registry#MOB_EFFECT status effect registry}.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -27,13 +27,12 @@ import cloud.commandframework.ArgumentDescription;
|
|||
import cloud.commandframework.arguments.CommandArgument;
|
||||
import cloud.commandframework.brigadier.argument.WrappedBrigadierParser;
|
||||
import cloud.commandframework.context.CommandContext;
|
||||
import java.util.List;
|
||||
import java.util.function.BiFunction;
|
||||
import net.minecraft.ChatFormatting;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.function.BiFunction;
|
||||
|
||||
/**
|
||||
* An argument for named colors in the {@link ChatFormatting} enum.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -27,11 +27,10 @@ import cloud.commandframework.ArgumentDescription;
|
|||
import cloud.commandframework.arguments.CommandArgument;
|
||||
import cloud.commandframework.brigadier.argument.WrappedBrigadierParser;
|
||||
import cloud.commandframework.context.CommandContext;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.function.BiFunction;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
/**
|
||||
* An argument for {@link net.minecraft.commands.arguments.NbtPathArgument.NbtPath NBT paths} to locations within
|
||||
|
|
|
|||
|
|
@ -27,13 +27,12 @@ import cloud.commandframework.ArgumentDescription;
|
|||
import cloud.commandframework.arguments.CommandArgument;
|
||||
import cloud.commandframework.brigadier.argument.WrappedBrigadierParser;
|
||||
import cloud.commandframework.context.CommandContext;
|
||||
import java.util.List;
|
||||
import java.util.function.BiFunction;
|
||||
import net.minecraft.nbt.Tag;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.function.BiFunction;
|
||||
|
||||
/**
|
||||
* An argument for the string representation of an NBT {@link Tag}.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -27,13 +27,12 @@ import cloud.commandframework.ArgumentDescription;
|
|||
import cloud.commandframework.arguments.CommandArgument;
|
||||
import cloud.commandframework.brigadier.argument.WrappedBrigadierParser;
|
||||
import cloud.commandframework.context.CommandContext;
|
||||
import java.util.List;
|
||||
import java.util.function.BiFunction;
|
||||
import net.minecraft.world.scores.criteria.ObjectiveCriteria;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.function.BiFunction;
|
||||
|
||||
/**
|
||||
* An argument for a {@linkplain ObjectiveCriteria criterion} in a scoreboard.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -27,13 +27,12 @@ import cloud.commandframework.ArgumentDescription;
|
|||
import cloud.commandframework.arguments.CommandArgument;
|
||||
import cloud.commandframework.brigadier.argument.WrappedBrigadierParser;
|
||||
import cloud.commandframework.context.CommandContext;
|
||||
import java.util.List;
|
||||
import java.util.function.BiFunction;
|
||||
import net.minecraft.core.particles.ParticleOptions;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.function.BiFunction;
|
||||
|
||||
/**
|
||||
* An argument for any {@link net.minecraft.core.particles.ParticleOptions}.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -36,6 +36,11 @@ import cloud.commandframework.fabric.FabricCommandContextKeys;
|
|||
import com.mojang.brigadier.StringReader;
|
||||
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
||||
import io.leangen.geantyref.TypeToken;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Queue;
|
||||
import java.util.Set;
|
||||
import java.util.function.BiFunction;
|
||||
import net.minecraft.commands.SharedSuggestionProvider;
|
||||
import net.minecraft.core.Registry;
|
||||
import net.minecraft.resources.ResourceKey;
|
||||
|
|
@ -43,12 +48,6 @@ import net.minecraft.resources.ResourceLocation;
|
|||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Queue;
|
||||
import java.util.Set;
|
||||
import java.util.function.BiFunction;
|
||||
|
||||
import static java.util.Objects.requireNonNull;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -27,13 +27,12 @@ import cloud.commandframework.ArgumentDescription;
|
|||
import cloud.commandframework.arguments.CommandArgument;
|
||||
import cloud.commandframework.brigadier.argument.WrappedBrigadierParser;
|
||||
import cloud.commandframework.context.CommandContext;
|
||||
import java.util.List;
|
||||
import java.util.function.BiFunction;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.function.BiFunction;
|
||||
|
||||
/**
|
||||
* An argument parsing a {@link ResourceLocation}.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -27,14 +27,13 @@ import cloud.commandframework.ArgumentDescription;
|
|||
import cloud.commandframework.arguments.CommandArgument;
|
||||
import cloud.commandframework.brigadier.argument.WrappedBrigadierParser;
|
||||
import cloud.commandframework.context.CommandContext;
|
||||
import java.util.List;
|
||||
import java.util.function.BiFunction;
|
||||
import net.minecraft.commands.arguments.OperationArgument;
|
||||
import net.minecraft.commands.arguments.OperationArgument.Operation;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.function.BiFunction;
|
||||
|
||||
/**
|
||||
* An argument for selecting any of the logical operations in {@link Operation}.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -27,13 +27,12 @@ import cloud.commandframework.arguments.parser.ArgumentParseResult;
|
|||
import cloud.commandframework.arguments.parser.ArgumentParser;
|
||||
import cloud.commandframework.context.CommandContext;
|
||||
import cloud.commandframework.fabric.FabricCommandContextKeys;
|
||||
import java.util.Queue;
|
||||
import net.fabricmc.fabric.api.client.command.v1.FabricClientCommandSource;
|
||||
import net.minecraft.commands.CommandSourceStack;
|
||||
import net.minecraft.commands.SharedSuggestionProvider;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import java.util.Queue;
|
||||
|
||||
/**
|
||||
* An argument parser that is resolved in different ways on the logical server and logical client.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -32,17 +32,16 @@ import cloud.commandframework.exceptions.parsing.NoInputProvidedException;
|
|||
import cloud.commandframework.exceptions.parsing.ParserException;
|
||||
import cloud.commandframework.fabric.FabricCaptionKeys;
|
||||
import cloud.commandframework.fabric.FabricCommandContextKeys;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Queue;
|
||||
import java.util.function.BiFunction;
|
||||
import net.fabricmc.fabric.api.client.command.v1.FabricClientCommandSource;
|
||||
import net.minecraft.commands.CommandSourceStack;
|
||||
import net.minecraft.world.scores.PlayerTeam;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Queue;
|
||||
import java.util.function.BiFunction;
|
||||
|
||||
/**
|
||||
* An argument for parsing {@link PlayerTeam Teams}.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -27,11 +27,10 @@ import cloud.commandframework.ArgumentDescription;
|
|||
import cloud.commandframework.arguments.CommandArgument;
|
||||
import cloud.commandframework.context.CommandContext;
|
||||
import cloud.commandframework.fabric.data.MinecraftTime;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.function.BiFunction;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
/**
|
||||
* An argument for in-game time.
|
||||
|
|
|
|||
|
|
@ -28,13 +28,12 @@ import cloud.commandframework.arguments.CommandArgument;
|
|||
import cloud.commandframework.context.CommandContext;
|
||||
import cloud.commandframework.fabric.argument.FabricArgumentParsers;
|
||||
import cloud.commandframework.fabric.data.Coordinates.BlockCoordinates;
|
||||
import java.util.List;
|
||||
import java.util.function.BiFunction;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.function.BiFunction;
|
||||
|
||||
/**
|
||||
* An argument for resolving {@link BlockCoordinates}.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -28,13 +28,12 @@ import cloud.commandframework.arguments.CommandArgument;
|
|||
import cloud.commandframework.context.CommandContext;
|
||||
import cloud.commandframework.fabric.argument.FabricArgumentParsers;
|
||||
import cloud.commandframework.fabric.data.Coordinates.ColumnCoordinates;
|
||||
import java.util.List;
|
||||
import java.util.function.BiFunction;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.function.BiFunction;
|
||||
|
||||
/**
|
||||
* An argument for resolving {@link ColumnCoordinates column (xz) coordinates}.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -28,11 +28,10 @@ import cloud.commandframework.arguments.CommandArgument;
|
|||
import cloud.commandframework.context.CommandContext;
|
||||
import cloud.commandframework.fabric.argument.FabricArgumentParsers;
|
||||
import cloud.commandframework.fabric.data.Message;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.function.BiFunction;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
/**
|
||||
* An argument similar to a greedy string, but one that resolves selectors.
|
||||
|
|
|
|||
|
|
@ -28,11 +28,10 @@ import cloud.commandframework.arguments.CommandArgument;
|
|||
import cloud.commandframework.context.CommandContext;
|
||||
import cloud.commandframework.fabric.argument.FabricArgumentParsers;
|
||||
import cloud.commandframework.fabric.data.MultipleEntitySelector;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.function.BiFunction;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
/**
|
||||
* An argument for selecting multiple {@link net.minecraft.world.entity.Entity entities} using an
|
||||
|
|
|
|||
|
|
@ -28,11 +28,10 @@ import cloud.commandframework.arguments.CommandArgument;
|
|||
import cloud.commandframework.context.CommandContext;
|
||||
import cloud.commandframework.fabric.argument.FabricArgumentParsers;
|
||||
import cloud.commandframework.fabric.data.MultiplePlayerSelector;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.function.BiFunction;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
/**
|
||||
* An argument for selecting multiple {@link net.minecraft.server.level.ServerPlayer players} using an
|
||||
|
|
|
|||
|
|
@ -28,11 +28,10 @@ import cloud.commandframework.arguments.CommandArgument;
|
|||
import cloud.commandframework.context.CommandContext;
|
||||
import cloud.commandframework.fabric.argument.FabricArgumentParsers;
|
||||
import cloud.commandframework.fabric.data.SingleEntitySelector;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.function.BiFunction;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
/**
|
||||
* An argument for selecting a single {@link net.minecraft.world.entity.Entity entity} using an
|
||||
|
|
|
|||
|
|
@ -28,11 +28,10 @@ import cloud.commandframework.arguments.CommandArgument;
|
|||
import cloud.commandframework.context.CommandContext;
|
||||
import cloud.commandframework.fabric.argument.FabricArgumentParsers;
|
||||
import cloud.commandframework.fabric.data.SinglePlayerSelector;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.function.BiFunction;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
/**
|
||||
* An argument for selecting a single {@link net.minecraft.server.level.ServerPlayer player} using an
|
||||
|
|
|
|||
|
|
@ -28,13 +28,12 @@ import cloud.commandframework.arguments.CommandArgument;
|
|||
import cloud.commandframework.context.CommandContext;
|
||||
import cloud.commandframework.fabric.argument.FabricArgumentParsers;
|
||||
import cloud.commandframework.fabric.data.Coordinates;
|
||||
import java.util.List;
|
||||
import java.util.function.BiFunction;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.function.BiFunction;
|
||||
|
||||
/**
|
||||
* An argument for resolving {@link cloud.commandframework.fabric.data.Coordinates.CoordinatesXZ} from 2 doubles.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -28,13 +28,12 @@ import cloud.commandframework.arguments.CommandArgument;
|
|||
import cloud.commandframework.context.CommandContext;
|
||||
import cloud.commandframework.fabric.argument.FabricArgumentParsers;
|
||||
import cloud.commandframework.fabric.data.Coordinates;
|
||||
import java.util.List;
|
||||
import java.util.function.BiFunction;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.function.BiFunction;
|
||||
|
||||
/**
|
||||
* An argument for resolving {@link Coordinates} from 3 doubles.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -23,12 +23,11 @@
|
|||
//
|
||||
package cloud.commandframework.fabric.data;
|
||||
|
||||
import java.util.Collection;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* A parsed message.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -23,11 +23,10 @@
|
|||
//
|
||||
package cloud.commandframework.fabric.data;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import java.time.temporal.TemporalUnit;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import static java.util.Objects.requireNonNull;
|
||||
|
||||
|
|
|
|||
|
|
@ -23,13 +23,12 @@
|
|||
//
|
||||
package cloud.commandframework.fabric.data;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import net.minecraft.commands.arguments.selector.EntitySelector;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
|
||||
/**
|
||||
* A selector string to query multiple entity-like values
|
||||
*
|
||||
|
|
|
|||
|
|
@ -26,11 +26,10 @@ package cloud.commandframework.fabric.mixin;
|
|||
import cloud.commandframework.brigadier.argument.StringReaderAsQueue;
|
||||
import cloud.commandframework.fabric.internal.CloudStringReader;
|
||||
import com.mojang.brigadier.StringReader;
|
||||
import java.util.Objects;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
/**
|
||||
* Mix in to our own class in order to implement the Queue interface without signature conflicts.
|
||||
|
|
|
|||
|
|
@ -32,6 +32,11 @@ import com.google.gson.JsonObject;
|
|||
import com.google.gson.internal.Streams;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import com.mojang.brigadier.CommandDispatcher;
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.time.Instant;
|
||||
import net.fabricmc.api.ClientModInitializer;
|
||||
import net.fabricmc.fabric.api.client.command.v1.FabricClientCommandSource;
|
||||
import net.fabricmc.loader.api.FabricLoader;
|
||||
|
|
@ -47,12 +52,6 @@ import net.minecraft.network.chat.TranslatableComponent;
|
|||
import net.minecraft.realms.RealmsBridge;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.time.Instant;
|
||||
|
||||
public final class FabricClientExample implements ClientModInitializer {
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -42,6 +42,10 @@ import cloud.commandframework.fabric.data.MultipleEntitySelector;
|
|||
import cloud.commandframework.fabric.data.MultiplePlayerSelector;
|
||||
import cloud.commandframework.fabric.testmod.mixin.GiveCommandAccess;
|
||||
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
||||
import java.util.Collection;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import net.fabricmc.api.ModInitializer;
|
||||
import net.fabricmc.loader.api.FabricLoader;
|
||||
import net.fabricmc.loader.api.ModContainer;
|
||||
|
|
@ -62,11 +66,6 @@ import net.minecraft.server.level.ServerPlayer;
|
|||
import net.minecraft.world.level.ChunkPos;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public final class FabricExample implements ModInitializer {
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@
|
|||
package cloud.commandframework.fabric.testmod.mixin;
|
||||
|
||||
import com.mojang.brigadier.Command;
|
||||
import java.util.Collection;
|
||||
import net.minecraft.commands.CommandSourceStack;
|
||||
import net.minecraft.commands.arguments.item.ItemInput;
|
||||
import net.minecraft.server.commands.GiveCommand;
|
||||
|
|
@ -31,8 +32,6 @@ import net.minecraft.server.level.ServerPlayer;
|
|||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.gen.Invoker;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
@Mixin(GiveCommand.class)
|
||||
public interface GiveCommandAccess {
|
||||
|
||||
|
|
|
|||
|
|
@ -23,11 +23,10 @@
|
|||
//
|
||||
package cloud.commandframework.minecraft.extras;
|
||||
|
||||
import java.util.function.Function;
|
||||
import net.kyori.adventure.audience.Audience;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import java.util.function.Function;
|
||||
|
||||
/**
|
||||
* Function that maps the command sender type to an adventure {@link net.kyori.adventure.audience.Audience}
|
||||
*
|
||||
|
|
|
|||
|
|
@ -23,15 +23,14 @@
|
|||
//
|
||||
package cloud.commandframework.minecraft.extras;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.regex.Pattern;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.TextComponent;
|
||||
import net.kyori.adventure.text.format.TextColor;
|
||||
import net.kyori.adventure.translation.GlobalTranslator;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
final class ComponentHelper {
|
||||
|
||||
public static final Pattern SPECIAL_CHARACTERS_PATTERN = Pattern.compile("[^\\s\\w\\-]");
|
||||
|
|
|
|||
|
|
@ -29,6 +29,12 @@ import cloud.commandframework.exceptions.CommandExecutionException;
|
|||
import cloud.commandframework.exceptions.InvalidCommandSenderException;
|
||||
import cloud.commandframework.exceptions.InvalidSyntaxException;
|
||||
import cloud.commandframework.exceptions.NoPermissionException;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.StringWriter;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.function.BiFunction;
|
||||
import java.util.function.Function;
|
||||
import net.kyori.adventure.audience.Audience;
|
||||
import net.kyori.adventure.identity.Identity;
|
||||
import net.kyori.adventure.text.Component;
|
||||
|
|
@ -39,13 +45,6 @@ import net.kyori.adventure.text.format.TextDecoration;
|
|||
import net.kyori.adventure.util.ComponentMessageThrowable;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
import java.io.StringWriter;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.function.BiFunction;
|
||||
import java.util.function.Function;
|
||||
|
||||
/**
|
||||
* Exception handler that sends {@link Component} to the sender. All component builders
|
||||
* can be overridden and the handled exception types can be configured (see {@link ExceptionType} for types)
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue