fix incorrectly updated move vector checking patch (#9328)

This commit is contained in:
Jake Potrebic 2023-06-12 11:26:43 -07:00 committed by GitHub
parent f8cfdd4ba9
commit de19eb8c4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;