9
0
mirror of https://github.com/BX-Team/DivineMC.git synced 2025-12-28 11:19:19 +00:00
Files
DivineMC/patches/server/0055-Fix-MC-177381.patch
2024-12-16 01:31:23 +03:00

26 lines
1.0 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
Date: Mon, 16 Dec 2024 01:22:14 +0300
Subject: [PATCH] Fix MC-177381
Original bug on Mojira https://bugs.mojang.com/browse/MC-177381
diff --git a/src/main/java/net/minecraft/server/commands/LocateCommand.java b/src/main/java/net/minecraft/server/commands/LocateCommand.java
index 2972f041eea95b92b37c2ab869f9f8ed3d142a27..894bc308d623be6afded9aceca9a85c3ec4ac66d 100644
--- a/src/main/java/net/minecraft/server/commands/LocateCommand.java
+++ b/src/main/java/net/minecraft/server/commands/LocateCommand.java
@@ -196,8 +196,10 @@ public class LocateCommand {
}
private static float dist(int x1, int y1, int x2, int y2) {
- int i = x2 - x1;
- int j = y2 - y1;
- return Mth.sqrt((float)(i * i + j * j));
+ // DivineMC start - Fix MC-177381
+ double i = x2 - x1;
+ double j = y2 - y1;
+ return (float) Math.hypot(i, j);
+ // DivineMC end
}
}