public class MathUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static double |
SQRT_OF_TWO |
| Constructor and Description |
|---|
MathUtils() |
| Modifier and Type | Method and Description |
|---|---|
static int |
ceil(float floatNumber)
Round the given float to the next whole number
|
static long |
chunkPositionToLong(int x,
int z)
Packs a chunk's X and Z coordinates into a single
long. |
static double |
constrain(double num,
double min,
double max)
If number is greater than the max, set it to max, and if number is lower than low, set it to low.
|
static Byte |
convertByte(Object value)
Converts the given object from an int or byte to byte.
|
public static int ceil(float floatNumber)
floatNumber - Float to roundpublic static double constrain(double num,
double min,
double max)
num - number to calculatemin - the lowest value the number can bemax - the greatest value the number can bepublic static Byte convertByte(Object value)
value - The value to convertpublic static long chunkPositionToLong(int x,
int z)
long.x - the X coordinatez - the Z coordinateCopyright © 2020 GeyserMC. All rights reserved.