diff --git a/src/main/java/net/minestom/server/entity/ai/goal/DoNothingGoal.java b/src/main/java/net/minestom/server/entity/ai/goal/DoNothingGoal.java index fac5017ab..787de9566 100644 --- a/src/main/java/net/minestom/server/entity/ai/goal/DoNothingGoal.java +++ b/src/main/java/net/minestom/server/entity/ai/goal/DoNothingGoal.java @@ -24,7 +24,7 @@ public class DoNothingGoal extends GoalSelector { public DoNothingGoal(EntityCreature entityCreature, long time, float chance) { super(entityCreature); this.time = time; - this.chance = MathUtils.setBetween(chance, 0, 1); + this.chance = MathUtils.clampFloat(chance, 0, 1); } @Override diff --git a/src/main/java/net/minestom/server/utils/MathUtils.java b/src/main/java/net/minestom/server/utils/MathUtils.java index d55f85c40..41f39c15f 100644 --- a/src/main/java/net/minestom/server/utils/MathUtils.java +++ b/src/main/java/net/minestom/server/utils/MathUtils.java @@ -59,18 +59,6 @@ public final class MathUtils { 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) { if (value < min) { return min;