2023-09-22 02:40:00 +10:00
From 730d5ceceb5c093c173981acde4121b55c95ff19 Mon Sep 17 00:00:00 2001
2016-03-01 08:33:06 +11:00
From: Jonas Konrad <me@yawk.at>
Date: Tue, 22 Jul 2014 15:59:01 +0200
Subject: [PATCH] Make "moved too quickly" limit configurable
2021-03-16 09:00:00 +11:00
diff --git a/src/main/java/net/minecraft/server/network/PlayerConnection.java b/src/main/java/net/minecraft/server/network/PlayerConnection.java
2023-09-22 02:40:00 +10:00
index 1041d8f870..d21836f630 100644
2021-03-16 09:00:00 +11:00
--- a/src/main/java/net/minecraft/server/network/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/network/PlayerConnection.java
2023-09-22 02:40:00 +10:00
@@ -503,7 +503,7 @@ public class PlayerConnection extends ServerCommonPacketListenerImpl implements
2016-03-26 14:16:36 +11:00
}
speed *= 2f; // TODO: Get the speed of the vehicle instead of the player
2021-11-22 09:00:00 +11:00
- if (d10 - d9 > Math.max(100.0D, Math.pow((double) (10.0F * (float) i * speed), 2)) && !this.isSingleplayerOwner()) {
+ if (d10 - d9 > Math.max(100.0D, Math.pow((double) (org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed), 2)) && !this.isSingleplayerOwner()) {
2016-03-26 14:16:36 +11:00
// CraftBukkit end
2022-03-01 02:00:00 +11:00
PlayerConnection.LOGGER.warn("{} (vehicle of {}) moved too quickly! {},{},{}", new Object[]{entity.getName().getString(), this.player.getName().getString(), d6, d7, d8});
2023-09-22 02:40:00 +10:00
this.send(new PacketPlayOutVehicleMove(entity));
@@ -1179,7 +1179,7 @@ public class PlayerConnection extends ServerCommonPacketListenerImpl implements
2023-06-08 01:30:00 +10:00
if (!this.player.isChangingDimension() && (!this.player.level().getGameRules().getBoolean(GameRules.RULE_DISABLE_ELYTRA_MOVEMENT_CHECK) || !this.player.isFallFlying())) {
2021-11-22 09:00:00 +11:00
float f2 = this.player.isFallFlying() ? 300.0F : 100.0F;
2016-03-26 14:16:36 +11:00
2023-06-08 01:30:00 +10:00
- if (d10 - d9 > Math.max(f2, Math.pow((double) (10.0F * (float) i * speed), 2)) && !this.isSingleplayerOwner()) {
+ if (d10 - d9 > Math.max(f2, Math.pow((double) (org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed), 2)) && !this.isSingleplayerOwner()) {
2016-12-21 07:00:00 +11:00
// CraftBukkit end
2023-06-08 01:30:00 +10:00
PlayerConnection.LOGGER.warn("{} moved too quickly! {},{},{}", new Object[]{this.player.getName().getString(), d6, d7, d8});
2021-11-22 09:00:00 +11:00
this.teleport(this.player.getX(), this.player.getY(), this.player.getZ(), this.player.getYRot(), this.player.getXRot());
2016-03-01 08:33:06 +11:00
diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java
2023-08-07 08:21:12 +10:00
index 9e34d30271..08f6ef8d48 100644
2016-03-01 08:33:06 +11:00
--- a/src/main/java/org/spigotmc/SpigotConfig.java
+++ b/src/main/java/org/spigotmc/SpigotConfig.java
2019-07-30 20:52:01 +10:00
@@ -332,4 +332,10 @@ public class SpigotConfig
2016-03-01 08:33:06 +11:00
{
movedWronglyThreshold = getDouble( "settings.moved-wrongly-threshold", 0.0625D );
}
+
2016-03-26 14:16:36 +11:00
+ public static double movedTooQuicklyMultiplier;
+ private static void movedTooQuicklyMultiplier()
2016-03-01 08:33:06 +11:00
+ {
2016-03-26 14:16:36 +11:00
+ movedTooQuicklyMultiplier = getDouble( "settings.moved-too-quickly-multiplier", 10.0D );
2016-03-01 08:33:06 +11:00
+ }
}
--
2023-09-22 02:40:00 +10:00
2.42.0
2016-03-01 08:33:06 +11:00