Class ExtraMath
java.lang.Object
com.github.imdabigboss.easydatapack.api.utils.ExtraMath
Some math utilities.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
ExtraMath
public ExtraMath()
-
-
Method Details
-
max
public static int max(int... a)Finds the biggest number in the provided arguments.- Parameters:
a- the numbers to compare- Returns:
- the biggest number
-
min
public static int min(int... a)Finds the smallest number in the provided arguments.- Parameters:
a- the numbers to compare- Returns:
- the smallest number
-
clamp
public static int clamp(int value, int min, int max)Clamp a number between two other numbers. For example if you have a number that is 10 and you want to clamp it between 0 and 5, it will return 5. If you have a number that is 3 and you want to clamp it between 0 and 5, it will return 3. If you have a number that is -1 and you want to clamp it between 0 and 5, it will return 0.- Parameters:
value- the number to clampmin- the minimum valuemax- the maximum value- Returns:
- the clamped number
-