Fix vehicle movement check

This commit is contained in:
Nassim Jahnke 2024-12-21 00:16:45 +01:00
parent a18b1b7ef1
commit 1dc6ad1df0
No known key found for this signature in database
GPG key ID: EF6771C01F6EF02F

View file

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