Contents
Class PrefabArgumentType
java.lang.Object
com.hypixel.hytale.server.core.command.system.arguments.types.ArgumentType<String>
com.hypixel.hytale.server.core.command.system.arguments.types.SingleArgumentType<String>
com.hypixel.hytale.builtin.buildertools.commands.PrefabArgumentType
- All Implemented Interfaces:
SuggestionProvider
Resolves a single prefab by key across all browsable locations (asset packs and the server directory).
Suggests every prefab and validates that the key resolves to an existing file. The parsed value is the
key as entered, which
PrefabStore.findBrowsablePrefabPath(String) re-resolves later.-
Field Summary
Fields inherited from class ArgumentType
EMPTY_EXAMPLES -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionparse(String input, ParseResult parseResult) voidsuggest(CommandSender sender, String textAlreadyEntered, int numParametersTyped, SuggestionResult result) Override this method to provide ArgumentType-specific suggestions that don't rely on the context of the command.Methods inherited from class SingleArgumentType
parse, withOverriddenUsage, withOverriddenUsage, withSharedSuggestionsMethods inherited from class ArgumentType
getArgumentUsage, getExamples, getName, getNumberOfParameters, getSuggestionTypeId, getSuggestionValueCount, isGreedyString, isListArgument, processedGet, toString
-
Constructor Details
-
PrefabArgumentType
-
-
Method Details
-
parse
Description copied from class:SingleArgumentTypeParses the inputStringand returns a value of TypeDataType. If anything goes wrong during parsing, you should useParseResult.fail(Message, Message...)and then return null- Specified by:
parsein classSingleArgumentType<String>- Parameters:
input- The argument String from the TokenizerparseResult- The parseResult to fail if anything goes wrong- Returns:
- the converted value
-
suggest
public void suggest(@Nonnull CommandSender sender, @Nonnull String textAlreadyEntered, int numParametersTyped, @Nonnull SuggestionResult result) Description copied from class:ArgumentTypeOverride this method to provide ArgumentType-specific suggestions that don't rely on the context of the command. UseSuggestionResult.suggest(Object)or any other "suggest" methods of SuggestionResult to provide the suggestions.- Specified by:
suggestin interfaceSuggestionProvider- Overrides:
suggestin classArgumentType<String>- Parameters:
sender- The sender who sent the commandtextAlreadyEntered- The text already entered for this commandnumParametersTyped- The number of parameters that have been typed, in relation toArgumentType.numberOfParametersresult- The result of the suggestions, append suggestions to this in order to provide them
-