Class CommandUtils
java.lang.Object
net.neoforged.neoforge.server.command.CommandUtils
Utility class for various command-related operations.
For modders and NeoForge to both use.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Optional
<ResourceKey<T>> getResourceKey
(com.mojang.brigadier.context.CommandContext<CommandSourceStack> ctx, String name, ResourceKey<Registry<T>> registryKey) 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)
-
Constructor Details
-
CommandUtils
private CommandUtils()
-
-
Method Details
-
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)
-