类 CommandUtils
java.lang.Object
net.neoforged.neoforge.server.command.CommandUtils
Utility class for various command-related operations.
For modders and NeoForge to both use.
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static <T> Optional
<ResourceKey<T>> getResourceKey
(com.mojang.brigadier.context.CommandContext<CommandSourceStack> ctx, String name, ResourceKey<Registry<T>> registryKey) static MutableComponent
static MutableComponent
makeTranslatableWithFallback
(String key, Object... args) static <T extends Registry<?>>
com.mojang.brigadier.suggestion.SuggestionProvider<CommandSourceStack> suggestFromRegistry
(Function<Registry<?>, Iterable<ResourceLocation>> namesFunction, String argumentString, ResourceKey<Registry<T>> registryKey) static CompletableFuture
<com.mojang.brigadier.suggestion.Suggestions> suggestRegistries
(com.mojang.brigadier.context.CommandContext<CommandSourceStack> ctx, com.mojang.brigadier.suggestion.SuggestionsBuilder builder)
-
构造器详细资料
-
CommandUtils
private CommandUtils()
-
-
方法详细资料
-
suggestRegistries
public static CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestRegistries(com.mojang.brigadier.context.CommandContext<CommandSourceStack> ctx, com.mojang.brigadier.suggestion.SuggestionsBuilder builder) -
suggestFromRegistry
public static <T extends Registry<?>> com.mojang.brigadier.suggestion.SuggestionProvider<CommandSourceStack> suggestFromRegistry(Function<Registry<?>, Iterable<ResourceLocation>> namesFunction, String argumentString, ResourceKey<Registry<T>> registryKey) -
getResourceKey
public static <T> Optional<ResourceKey<T>> getResourceKey(com.mojang.brigadier.context.CommandContext<CommandSourceStack> ctx, String name, ResourceKey<Registry<T>> registryKey) -
makeTranslatableWithFallback
-
makeTranslatableWithFallback
-