CommandAPI 9.7.0
An API for the command UI introduced in Minecraft 1.13
|
A representation of the math operations for the Minecraft scoreboard. More...
Public Member Functions | |
MathOperation (String stringValue, BinaryOperator< Float > application) | |
Construct a MathOperation with its respective Minecraft string value. More... | |
String | toString () |
Returns the Minecraft string value of this MathOperation. More... | |
int | apply (int val1, int val2) |
Applies the current MathOperation to two ints. More... | |
float | apply (float val1, float val2) |
Applies the current MathOperation to two floats. More... | |
Static Public Member Functions | |
static MathOperation | fromString (String input) |
Creates a MathOperation from the Minecraft string representation (e.g. More... | |
A representation of the math operations for the Minecraft scoreboard.
dev.jorel.commandapi.wrappers.MathOperation.MathOperation | ( | String | stringValue, |
BinaryOperator< Float > | application | ||
) |
Construct a MathOperation with its respective Minecraft string value.
stringValue |
float dev.jorel.commandapi.wrappers.MathOperation.apply | ( | float | val1, |
float | val2 | ||
) |
Applies the current MathOperation to two floats.
val1 | the base float to operate on |
val2 | the new value to operate with |
int dev.jorel.commandapi.wrappers.MathOperation.apply | ( | int | val1, |
int | val2 | ||
) |
Applies the current MathOperation to two ints.
val1 | the base int to operate on |
val2 | the new value to operate with |
|
static |
Creates a MathOperation from the Minecraft string representation (e.g.
"=" or "/=")
input | the string to convert to |
IllegalArgumentException | if the input is not a valid MathOperation |
String dev.jorel.commandapi.wrappers.MathOperation.toString | ( | ) |
Returns the Minecraft string value of this MathOperation.