Class ArgumentRelativeVec
java.lang.Object
net.minestom.server.command.builder.arguments.Argument<T>
net.minestom.server.command.builder.arguments.relative.ArgumentRelative<RelativeVec>
net.minestom.server.command.builder.arguments.relative.ArgumentRelativeVec
- Direct Known Subclasses:
ArgumentRelativeVec2
,ArgumentRelativeVec3
public abstract class ArgumentRelativeVec extends ArgumentRelative<RelativeVec>
Common super class for
ArgumentRelativeVec2
and ArgumentRelativeVec3
.-
Field Summary
Fields inherited from class net.minestom.server.command.builder.arguments.relative.ArgumentRelative
INVALID_NUMBER_COUNT_ERROR, INVALID_NUMBER_ERROR, RELATIVE_CHAR
Fields inherited from class net.minestom.server.command.builder.arguments.Argument
SUCCESS, UNDEFINED_ERROR
-
Constructor Summary
Constructors Constructor Description ArgumentRelativeVec(java.lang.String id, int numberCount)
-
Method Summary
Modifier and Type Method Description int
getConditionResult(RelativeVec value)
Called afterArgument.parse(String)
meaning thatvalue
should already represent a valid representation of the input.int
getCorrectionResult(java.lang.String value)
First method called to check the validity of an input.Methods inherited from class net.minestom.server.command.builder.arguments.relative.ArgumentRelative
getNumberCount
Methods inherited from class net.minestom.server.command.builder.arguments.Argument
allowSpace, getCallback, getId, hasErrorCallback, parse, setCallback, useRemaining
-
Constructor Details
-
ArgumentRelativeVec
public ArgumentRelativeVec(@NotNull java.lang.String id, int numberCount)
-
-
Method Details
-
getCorrectionResult
public int getCorrectionResult(@NotNull java.lang.String value)Description copied from class:Argument
First method called to check the validity of an input.If
Argument.allowSpace()
is enabled, the value will be incremented by the next word until it returnsArgument.SUCCESS
, meaning that you need to be sure to check the inexpensive operations first (eg the number of brackets, the first and last char, etc...).- Specified by:
getCorrectionResult
in classArgument<RelativeVec>
- Parameters:
value
- The received argument- Returns:
- the error code or
Argument.SUCCESS
-
getConditionResult
Description copied from class:Argument
Called afterArgument.parse(String)
meaning thatvalue
should already represent a valid representation of the input.The condition result has for goal to check the optional conditions that are user configurable (eg min/max values for a number, a specific material for an item, etc...).
- Specified by:
getConditionResult
in classArgument<RelativeVec>
- Parameters:
value
- The parsed argument- Returns:
- the error code or
Argument.SUCCESS
-