Class BrigadierCommandRegistry.BrigadierArgumentShape
java.lang.Object
dev.ua.theroer.magicutils.commands.brigadier.BrigadierCommandRegistry.BrigadierArgumentShape
- Enclosing class:
BrigadierCommandRegistry<S>
Brigadier-side shape for a single command argument.
-
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.brigadier.arguments.ArgumentType<?> Returns the underlying Brigadier argument type.Returns the list of literal alternatives for this argument.nativeSuggestions(com.mojang.brigadier.arguments.ArgumentType<?> argumentType) Creates a shape that uses native Brigadier suggestions for this argument.of(com.mojang.brigadier.arguments.ArgumentType<?> argumentType) Creates a shape from a standard Brigadier argument type.booleanReturns whether to use native suggestions.withLiteralAlternative(String literal) Returns a new shape with an added literal alternative.withLiteralAlternatives(String... literals) Returns a new shape with added literal alternatives.withLiteralAlternatives(List<String> literals) Returns a new shape with added literal alternatives.
-
Method Details
-
of
public static BrigadierCommandRegistry.BrigadierArgumentShape of(com.mojang.brigadier.arguments.ArgumentType<?> argumentType) Creates a shape from a standard Brigadier argument type.- Parameters:
argumentType- Brigadier argument type- Returns:
- argument shape
-
nativeSuggestions
public static BrigadierCommandRegistry.BrigadierArgumentShape nativeSuggestions(com.mojang.brigadier.arguments.ArgumentType<?> argumentType) Creates a shape that uses native Brigadier suggestions for this argument.- Parameters:
argumentType- Brigadier argument type- Returns:
- argument shape
-
argumentType
public com.mojang.brigadier.arguments.ArgumentType<?> argumentType()Returns the underlying Brigadier argument type.- Returns:
- argument type
-
useNativeSuggestions
public boolean useNativeSuggestions()Returns whether to use native suggestions.- Returns:
- true for native suggestions
-
literalAlternatives
-
withLiteralAlternative
Returns a new shape with an added literal alternative.- Parameters:
literal- literal value- Returns:
- new shape
-
withLiteralAlternatives
Returns a new shape with added literal alternatives.- Parameters:
literals- literal values- Returns:
- new shape
-
withLiteralAlternatives
public BrigadierCommandRegistry.BrigadierArgumentShape withLiteralAlternatives(List<String> literals) Returns a new shape with added literal alternatives.- Parameters:
literals- literal values- Returns:
- new shape
-