mirror of
https://github.com/Minestom/Minestom.git
synced 2024-11-08 03:40:27 +01:00
Remove useless math methods
This commit is contained in:
parent
7ccd40d0f7
commit
18c7a61f89
@ -24,7 +24,7 @@ public class DoNothingGoal extends GoalSelector {
|
|||||||
public DoNothingGoal(EntityCreature entityCreature, long time, float chance) {
|
public DoNothingGoal(EntityCreature entityCreature, long time, float chance) {
|
||||||
super(entityCreature);
|
super(entityCreature);
|
||||||
this.time = time;
|
this.time = time;
|
||||||
this.chance = MathUtils.setBetween(chance, 0, 1);
|
this.chance = MathUtils.clampFloat(chance, 0, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -59,18 +59,6 @@ public final class MathUtils {
|
|||||||
return number >= min && number <= max;
|
return number >= min && number <= max;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static byte setBetween(byte number, byte min, byte max) {
|
|
||||||
return number > max ? max : number < min ? min : number;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static int setBetween(int number, int min, int max) {
|
|
||||||
return number > max ? max : Math.max(number, min);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static float setBetween(float number, float min, float max) {
|
|
||||||
return number > max ? max : Math.max(number, min);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static int clamp(int value, int min, int max) {
|
public static int clamp(int value, int min, int max) {
|
||||||
if (value < min) {
|
if (value < min) {
|
||||||
return min;
|
return min;
|
||||||
|
Loading…
Reference in New Issue
Block a user