Compare commits

...

1 Commits

Author SHA1 Message Date
Sofiane H. Djerbi
e196a52ebe Patches 2023-06-17 21:03:45 +03:00
2 changed files with 35 additions and 1 deletions

View File

@@ -1,5 +1,5 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: "Sofiane H. Djerbi" <46628754+kugge@users.noreply.github.com>
From: Xymb <xymb@endcrystal.me>
Date: Sat, 17 Jun 2023 19:52:29 +0300
Subject: [PATCH] Swap distanceToSqr and EntitySelector

View File

@@ -0,0 +1,34 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Xymb <xymb@endcrystal.me>
Date: Sat, 17 Jun 2023 21:03:04 +0300
Subject: [PATCH] Use Math.floor instead of fastfloot
diff --git a/src/main/java/io/papermc/paper/util/MCUtil.java b/src/main/java/io/papermc/paper/util/MCUtil.java
index 38441121cf7cdc1d64ef9fc17ae76dc16fbf96f2..3f76e1bc0c08775353d22b7d928536aba9c8ad1d 100644
--- a/src/main/java/io/papermc/paper/util/MCUtil.java
+++ b/src/main/java/io/papermc/paper/util/MCUtil.java
@@ -164,13 +164,19 @@ public final class MCUtil {
}
public static int fastFloor(double x) {
- int truncated = (int)x;
- return x < (double)truncated ? truncated - 1 : truncated;
+ // Kaiiju start - Use Math.floor instead of fastfloor
+ return (int)Math.floor(x); // Kaiiju
+ //int truncated = (int)x;
+ //return x < (double)truncated ? truncated - 1 : truncated;
+ // Kaiiju end
}
public static int fastFloor(float x) {
- int truncated = (int)x;
- return x < (double)truncated ? truncated - 1 : truncated;
+ // Kaiiju start - Use Math.floor instead of fastfloor
+ return (int)Math.floor(x); // Kaiiju
+ //int truncated = (int)x;
+ //return x < (double)truncated ? truncated - 1 : truncated;
+ // Kaiiju end
}
public static float normalizeYaw(float f) {