public interface IDatatype
IDatatype
is similar to an IArgParser
in the sense that it is capable of consuming an argument
to transform it into a usable form as the code desires.
A fundamental difference is that an IDatatype
is capable of consuming multiple arguments. For example,
RelativeBlockPos
is an IDatatypePost
which requires at least 3 RelativeCoordinate
arguments
to be specified.
Another difference is that an IDatatype
can be tab-completed, providing comprehensive auto completion
that can substitute based on existing input or provide possibilities for the next piece of input.
IDatatypeContext
,
IDatatypeFor
,
IDatatypePost
Modifier and Type | Method and Description |
---|---|
java.util.stream.Stream<java.lang.String> |
tabComplete(IDatatypeContext ctx)
Attempts to complete missing or partial input provided through the
IArgConsumer } provided by
IDatatypeContext.getConsumer() in order to aide the user in executing commands. |
java.util.stream.Stream<java.lang.String> tabComplete(IDatatypeContext ctx) throws CommandException
IArgConsumer
} provided by
IDatatypeContext.getConsumer()
in order to aide the user in executing commands.
One benefit over datatypes over IArgParser
s is that instead of each command trying to guess what values
the datatype will accept, or simply not tab completing at all, datatypes that support tab completion can provide
accurate information using the same methods used to parse arguments in the first place.
ctx
- The argument consumer to tab completeCommandException
IArgConsumer.tabCompleteDatatype(IDatatype)