public final class MathsUtils
extends java.lang.Object
| Constructor and Description |
|---|
MathsUtils() |
| Modifier and Type | Method and Description |
|---|---|
static int |
getAvailableBiomeID()
Attempts to find a biome ID which is vacant.
|
static int |
getAverage(int first,
int second)
Gets the middle integer between two other integers.
|
static int |
getNextEnchantmentID()
Attempts to find an Enchantment ID which is vacant.
|
static int |
getNextPotionID()
Attempts to find a Potion ID which is vacant.
|
static int |
getRandomColor()
Generates a random color as an integer, from Color and three random floats.
|
static int |
nextIntInclusive(int min,
int max)
Used to retrieve a random integer between the two provided integers.
|
static net.minecraft.util.MovingObjectPosition |
rayTrace(net.minecraft.entity.player.EntityPlayer player,
double length)
Creates a MovingObjectPosition based on where a player is looking.
|
static double |
round(double value,
int places)
This method can be used to round a double to a certain amount of places.
|
static boolean |
tryPercentage(double percent)
A method which handles the calculating of percentages.
|
public static double round(double value,
int places)
value: - The double being round.places: - The amount of places to round the double to.public static int nextIntInclusive(int min,
int max)
min: - The minimum value which can be returned by this method.max: - The maximum value which can be returned by this method.public static net.minecraft.util.MovingObjectPosition rayTrace(net.minecraft.entity.player.EntityPlayer player,
double length)
player: - The player to get the looking position of.length: - The distance to go outwards from the player, the maximum "reach". Default
reach is 4.5D.public static boolean tryPercentage(double percent)
percent: - The percent chance that this method should return true. 1.00 = 100%public static int getRandomColor()
public static int getAvailableBiomeID()
public static int getNextEnchantmentID()
public static int getNextPotionID()
public static int getAverage(int first,
int second)
first: - The first integer.second: - The second integer.