From 1dc6ad1df07e018ee68d95464022285f27fff916 Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Sat, 21 Dec 2024 00:16:45 +0100 Subject: [PATCH] Fix vehicle movement check --- .../network/ServerGamePacketListenerImpl.java.patch | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/paper-server/patches/sources/net/minecraft/server/network/ServerGamePacketListenerImpl.java.patch b/paper-server/patches/sources/net/minecraft/server/network/ServerGamePacketListenerImpl.java.patch index c4a14444de..c53210937f 100644 --- a/paper-server/patches/sources/net/minecraft/server/network/ServerGamePacketListenerImpl.java.patch +++ b/paper-server/patches/sources/net/minecraft/server/network/ServerGamePacketListenerImpl.java.patch @@ -211,9 +211,9 @@ + double currDeltaY = toY - y; + double currDeltaZ = toZ - z; + d7 = Math.max(d7, (currDeltaX * currDeltaX + currDeltaY * currDeltaY + currDeltaZ * currDeltaZ) - 1); -+ double otherFieldX = d3 - this.vehicleLastGoodX; -+ double otherFieldY = d4 - this.vehicleLastGoodY; -+ double otherFieldZ = d5 - this.vehicleLastGoodZ; ++ double otherFieldX = toX - this.vehicleLastGoodX; ++ double otherFieldY = toY - this.vehicleLastGoodY; ++ double otherFieldZ = toZ - this.vehicleLastGoodZ; + d7 = Math.max(d7, (otherFieldX * otherFieldX + otherFieldY * otherFieldY + otherFieldZ * otherFieldZ) - 1); + // Paper end - fix large move vectors killing the server + @@ -251,7 +251,7 @@ + return; + } + // Paper end - Prevent moving into unloaded chunks -+ if (d7 - d6 > Math.max(100.0D, Math.pow((double) (org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed), 2)) && !this.isSingleplayerOwner()) { ++ if (d7 - d6 > Math.max(100.0, Math.pow((double) (org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed), 2)) && !this.isSingleplayerOwner()) { + // CraftBukkit end LOGGER.warn( "{} (vehicle of {}) moved too quickly! {},{},{}", rootVehicle.getName().getString(), this.player.getName().getString(), d3, d4, d5