From de19eb8c4a490ff4f427e9ad8b8bbe181c368cc1 Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Mon, 12 Jun 2023 11:26:43 -0700 Subject: [PATCH] fix incorrectly updated move vector checking patch (#9328) --- .../0477-Fix-for-large-move-vectors-crashing-server.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/patches/server/0477-Fix-for-large-move-vectors-crashing-server.patch b/patches/server/0477-Fix-for-large-move-vectors-crashing-server.patch index 41c3f00dd6..8c3fcee885 100644 --- a/patches/server/0477-Fix-for-large-move-vectors-crashing-server.patch +++ b/patches/server/0477-Fix-for-large-move-vectors-crashing-server.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Fix for large move vectors crashing server Check movement distance also based on current position. diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index b0d43cda858373d1e15f795d0b216cbdc7936db1..a4233fa223bdf9b29a3d75b84ef38640331d7fb8 100644 +index b0d43cda858373d1e15f795d0b216cbdc7936db1..c274a52cd4311350bfc2ccbac81b2c798e1c038a 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -567,9 +567,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -66,7 +66,7 @@ index b0d43cda858373d1e15f795d0b216cbdc7936db1..a4233fa223bdf9b29a3d75b84ef38640 + double currDeltaX = toX - prevX; + double currDeltaY = toY - prevY; + double currDeltaZ = toZ - prevZ; -+ double d10 = Math.max(d7 * d7 + d8 * d8 + d9 * d9, (currDeltaX * currDeltaX + currDeltaY * currDeltaY + currDeltaZ * currDeltaZ) - 1); ++ double d10 = Math.max(d6 * d6 + d7 * d7 + d8 * d8, (currDeltaX * currDeltaX + currDeltaY * currDeltaY + currDeltaZ * currDeltaZ) - 1); + // Paper end - fix large move vectors killing the server + // Paper start - fix large move vectors killing the server + double otherFieldX = d0 - this.lastGoodX;