aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io/github/moulberry/notenoughupdates/util/MathUtil.java
diff options
context:
space:
mode:
authorGodOfPro <59516901+GodOfProDev@users.noreply.github.com>2022-11-10 00:36:45 +0330
committerGitHub <noreply@github.com>2022-11-09 22:06:45 +0100
commit3ffff3428b72371b35ea3067ae33588d89e7fc85 (patch)
treefbd9ea997ee4d0d822290548ef76ae315b5fdf24 /src/main/java/io/github/moulberry/notenoughupdates/util/MathUtil.java
parent8f8ced3155c2c694dd7d5326e635b51c112cb79f (diff)
downloadnotenoughupdates-3ffff3428b72371b35ea3067ae33588d89e7fc85.tar.gz
notenoughupdates-3ffff3428b72371b35ea3067ae33588d89e7fc85.tar.bz2
notenoughupdates-3ffff3428b72371b35ea3067ae33588d89e7fc85.zip
Added Endernode Highlighter (#421)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/util/MathUtil.java')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/util/MathUtil.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/MathUtil.java b/src/main/java/io/github/moulberry/notenoughupdates/util/MathUtil.java
index f358f37f..c440e637 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/util/MathUtil.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/util/MathUtil.java
@@ -23,4 +23,10 @@ public class MathUtil {
public static boolean isDecimalPartApproximately(double fullValue, double expectedDecimalPart) {
return Math.abs(Math.abs(fullValue % 1) - expectedDecimalPart) < 0.01;
}
+ public static boolean basicallyEqual(double num1, double num2, double dist) {
+ return Math.abs(num1 - num2) < dist;
+ }
+ public static boolean basicallyEqual(double num1, double num2) {
+ return Math.abs(num1 - num2) < 0.01;
+ }
}