Defining types
In order to define a type, you should use TypeBuilder
.
This is a helper class to make defining types easier.
TypeBuilder
will create a TypeOptions for you, using the values you provide to each method.
This object is used to register the type.
The string
you provide to TypeBuilder.create
will be the name of the type.
It may be useful to store your type names in an enum or constant to make them
more accessible - see CenturionType
for an example.
Methods
-
transform: Takes a function that receives the argument text and the executor of the command and returns a
TransformResult
. -
suggestions: Optional, takes a function that returns an array of strings.