类 TagsCommand
java.lang.Object
net.minecraftforge.server.command.TagsCommand
The
/forge tags
command for listing a registry's tags, getting the elements of tags, and querying the tags of a
registry object.
Each command is paginated, showing 8L entries at a time. When there are more than 0 entries,
the text indicating the amount of entries is highlighted and can be clicked to copy the list of all entries (across
all pages) to the clipboard. (This is reflected by the use of green text in brackets, mimicking the clickable
coordinates in the /locate
command's message)
The command has three subcommands:
/forge tags <registry> list [page]
- Lists all available tags in the given registry./forge tags <registry> get <tag> [page]
- Gets all elements of the given tag in the given registry./forge tags <registry> query <element> [page]
- Queries for all tags in the given registry which contain the given registry object.
-
字段概要
字段修饰符和类型字段说明private static final long
private static final ResourceKey
<Registry<Registry<?>>> private static final com.mojang.brigadier.exceptions.Dynamic2CommandExceptionType
private static final com.mojang.brigadier.exceptions.DynamicCommandExceptionType
private static final com.mojang.brigadier.exceptions.Dynamic2CommandExceptionType
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明private static <O> O
private static MutableComponent
createMessage
(MutableComponent header, String containsText, String copyHoverText, long count, long currentPage, ChatFormatting elementColor, Supplier<Stream<String>> names) private static <T> Optional
<ResourceKey<T>> getResourceKey
(com.mojang.brigadier.context.CommandContext<CommandSourceStack> ctx, String name, ResourceKey<Registry<T>> registryKey) private static int
listTagElements
(com.mojang.brigadier.context.CommandContext<CommandSourceStack> ctx, int page) private static int
listTags
(com.mojang.brigadier.context.CommandContext<CommandSourceStack> ctx, int page) private static <T> int
queryElementTags
(com.mojang.brigadier.context.CommandContext<CommandSourceStack> ctx, int page) static com.mojang.brigadier.builder.ArgumentBuilder
<CommandSourceStack, ?> register()
private static com.mojang.brigadier.suggestion.SuggestionProvider
<CommandSourceStack> suggestFromRegistry
(Function<Registry<?>, Iterable<ResourceLocation>> namesFunction) private static CompletableFuture
<com.mojang.brigadier.suggestion.Suggestions> suggestRegistries
(com.mojang.brigadier.context.CommandContext<CommandSourceStack> ctx, com.mojang.brigadier.suggestion.SuggestionsBuilder builder)
-
字段详细资料
-
PAGE_SIZE
private static final long PAGE_SIZE- 另请参阅:
-
ROOT_REGISTRY_KEY
-
UNKNOWN_REGISTRY
private static final com.mojang.brigadier.exceptions.DynamicCommandExceptionType UNKNOWN_REGISTRY -
UNKNOWN_TAG
private static final com.mojang.brigadier.exceptions.Dynamic2CommandExceptionType UNKNOWN_TAG -
UNKNOWN_ELEMENT
private static final com.mojang.brigadier.exceptions.Dynamic2CommandExceptionType UNKNOWN_ELEMENT
-
-
构造器详细资料
-
TagsCommand
TagsCommand()
-
-
方法详细资料
-
register
-
listTags
private static int listTags(com.mojang.brigadier.context.CommandContext<CommandSourceStack> ctx, int page) throws com.mojang.brigadier.exceptions.CommandSyntaxException - 抛出:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
listTagElements
private static int listTagElements(com.mojang.brigadier.context.CommandContext<CommandSourceStack> ctx, int page) throws com.mojang.brigadier.exceptions.CommandSyntaxException - 抛出:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
queryElementTags
private static <T> int queryElementTags(com.mojang.brigadier.context.CommandContext<CommandSourceStack> ctx, int page) throws com.mojang.brigadier.exceptions.CommandSyntaxException - 抛出:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
createMessage
private static MutableComponent createMessage(MutableComponent header, String containsText, String copyHoverText, long count, long currentPage, ChatFormatting elementColor, Supplier<Stream<String>> names) -
suggestRegistries
private static CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestRegistries(com.mojang.brigadier.context.CommandContext<CommandSourceStack> ctx, com.mojang.brigadier.suggestion.SuggestionsBuilder builder) -
suggestFromRegistry
private static com.mojang.brigadier.suggestion.SuggestionProvider<CommandSourceStack> suggestFromRegistry(Function<Registry<?>, Iterable<ResourceLocation>> namesFunction) -
getResourceKey
private static <T> Optional<ResourceKey<T>> getResourceKey(com.mojang.brigadier.context.CommandContext<CommandSourceStack> ctx, String name, ResourceKey<Registry<T>> registryKey) -
cast
-