mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-14 13:43:55 +01:00
Fix vehicle movement check
This commit is contained in:
parent
a18b1b7ef1
commit
1dc6ad1df0
1 changed files with 4 additions and 4 deletions
|
@ -211,9 +211,9 @@
|
||||||
+ double currDeltaY = toY - y;
|
+ double currDeltaY = toY - y;
|
||||||
+ double currDeltaZ = toZ - z;
|
+ double currDeltaZ = toZ - z;
|
||||||
+ d7 = Math.max(d7, (currDeltaX * currDeltaX + currDeltaY * currDeltaY + currDeltaZ * currDeltaZ) - 1);
|
+ d7 = Math.max(d7, (currDeltaX * currDeltaX + currDeltaY * currDeltaY + currDeltaZ * currDeltaZ) - 1);
|
||||||
+ double otherFieldX = d3 - this.vehicleLastGoodX;
|
+ double otherFieldX = toX - this.vehicleLastGoodX;
|
||||||
+ double otherFieldY = d4 - this.vehicleLastGoodY;
|
+ double otherFieldY = toY - this.vehicleLastGoodY;
|
||||||
+ double otherFieldZ = d5 - this.vehicleLastGoodZ;
|
+ double otherFieldZ = toZ - this.vehicleLastGoodZ;
|
||||||
+ d7 = Math.max(d7, (otherFieldX * otherFieldX + otherFieldY * otherFieldY + otherFieldZ * otherFieldZ) - 1);
|
+ d7 = Math.max(d7, (otherFieldX * otherFieldX + otherFieldY * otherFieldY + otherFieldZ * otherFieldZ) - 1);
|
||||||
+ // Paper end - fix large move vectors killing the server
|
+ // Paper end - fix large move vectors killing the server
|
||||||
+
|
+
|
||||||
|
@ -251,7 +251,7 @@
|
||||||
+ return;
|
+ return;
|
||||||
+ }
|
+ }
|
||||||
+ // Paper end - Prevent moving into unloaded chunks
|
+ // 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
|
+ // CraftBukkit end
|
||||||
LOGGER.warn(
|
LOGGER.warn(
|
||||||
"{} (vehicle of {}) moved too quickly! {},{},{}", rootVehicle.getName().getString(), this.player.getName().getString(), d3, d4, d5
|
"{} (vehicle of {}) moved too quickly! {},{},{}", rootVehicle.getName().getString(), this.player.getName().getString(), d3, d4, d5
|
||||||
|
|
Loading…
Reference in a new issue