Class RegistryArgumentExtractor
java.lang.Object
io.papermc.paper.command.brigadier.argument.RegistryArgumentExtractor
Utilities for extracting registry-related arguments from a
CommandContext.-
Method Summary
Modifier and TypeMethodDescriptionstatic <T,S> TypedKey <T> getTypedKey(com.mojang.brigadier.context.CommandContext<S> context, RegistryKey<T> registryKey, String name) Gets a typed key argument from a command context.
-
Method Details
-
getTypedKey
public static <T,S> TypedKey<T> getTypedKey(com.mojang.brigadier.context.CommandContext<S> context, RegistryKey<T> registryKey, String name) Gets a typed key argument from a command context.- Type Parameters:
T- the value typeS- the sender type- Parameters:
context- the command contextregistryKey- the registry key for the typed keyname- the argument name- Returns:
- the typed key argument
- Throws:
IllegalArgumentException- if the registry key doesn't match the typed key
-