From 86c6308faf28dedeeeecdce03af283a47a076a71 Mon Sep 17 00:00:00 2001 From: Creeam <102713261+HaHaWTH@users.noreply.github.com> Date: Sun, 12 Jan 2025 08:55:45 -0800 Subject: [PATCH] Fix locate command dist overflow/underflow (#11956) --- .../minecraft/server/commands/LocateCommand.java.patch | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 paper-server/patches/sources/net/minecraft/server/commands/LocateCommand.java.patch diff --git a/paper-server/patches/sources/net/minecraft/server/commands/LocateCommand.java.patch b/paper-server/patches/sources/net/minecraft/server/commands/LocateCommand.java.patch new file mode 100644 index 000000000000..455b4cb07460 --- /dev/null +++ b/paper-server/patches/sources/net/minecraft/server/commands/LocateCommand.java.patch @@ -0,0 +1,10 @@ +--- a/net/minecraft/server/commands/LocateCommand.java ++++ b/net/minecraft/server/commands/LocateCommand.java +@@ -202,6 +_,6 @@ + private static float dist(int x1, int z1, int x2, int z2) { + int i = x2 - x1; + int i1 = z2 - z1; +- return Mth.sqrt(i * i + i1 * i1); ++ return (float) Math.hypot(i, i1); // Paper - Fix MC-177381 + } + }