Skip to content

Commit

Permalink
Patches
Browse files Browse the repository at this point in the history
  • Loading branch information
sofianedjerbi committed Jun 17, 2023
1 parent 61f2cb8 commit e196a52
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: "Sofiane H. Djerbi" <[email protected]>
From: Xymb <[email protected]>
Date: Sat, 17 Jun 2023 19:52:29 +0300
Subject: [PATCH] Swap distanceToSqr and EntitySelector

Expand Down
34 changes: 34 additions & 0 deletions patches/server/0027-Use-Math.floor-instead-of-fastfloot.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Xymb <[email protected]>
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) {

0 comments on commit e196a52

Please sign in to comment.