Interface MultipleOptionsArgument.ArgumentOption<TValue>
- Type Parameters:
TValue- the generic type of the option parser.
- All Known Implementing Classes:
ColonyIdArgument.ColonyIdOption,ColonyIdArgument.HereOption,ColonyIdArgument.MineOption,ColonyIdArgument.PlayerNameOption,ColonyIdArgument.PlayerUuidOption,MultiColonyIdArgument.AllOption
- Enclosing class:
- MultipleOptionsArgument<TValue>
public static interface MultipleOptionsArgument.ArgumentOption<TValue>
A singular argument option, this is responsible for checking if the argument value matches the expected user input.
This class is also responsible for resolving the finalized value after the matching succeeded.
-
Method Summary
Modifier and TypeMethodDescriptionvoidcreateSuggestions(net.minecraft.world.level.Level world, net.minecraft.commands.SharedSuggestionProvider suggestionProvider, com.mojang.brigadier.suggestion.SuggestionsBuilder builder) Build any potential suggestions that this option can list for the argument preview when typing.booleanCheck if the user defined input matches what this specific argument expects.resolveValue(net.minecraft.commands.CommandSourceStack source, String value) Resolves a value from the command source during post execution of the command.
-
Method Details
-
matches
Check if the user defined input matches what this specific argument expects. If this method returns false the process will transfer to the next option.- Parameters:
value- the original user input.- Returns:
- true if the option matches the user input, false if not.
-
resolveValue
TValue resolveValue(net.minecraft.commands.CommandSourceStack source, String value) throws com.mojang.brigadier.exceptions.CommandSyntaxException Resolves a value from the command source during post execution of the command.- Parameters:
source- the command source stack.value- the original user input.- Returns:
- the finalized value that the specific implementation expects.
- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException- when the resolver fails to resolve the finalized value.
-