2020-01-22 08:00:00 +11:00
From a16e151dc5d6b5140a2472dc2cd0e2720d194c47 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
2016-03-26 14:16:36 +11:00
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
2020-01-22 08:00:00 +11:00
index 1ab3ae3cc..6e7914216 100644
2016-03-26 14:16:36 +11:00
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
2019-12-11 09:00:00 +11:00
@@ -339,7 +339,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
2016-03-26 14:16:36 +11:00
}
speed *= 2f; // TODO: Get the speed of the vehicle instead of the player
2019-04-23 12:00:00 +10:00
- if (d10 - d9 > Math.max(100.0D, Math.pow((double) (10.0F * (float) i * speed), 2)) && !this.isExemptPlayer()) {
+ if (d10 - d9 > Math.max(100.0D, Math.pow((double) (org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed), 2)) && !this.isExemptPlayer()) {
2016-03-26 14:16:36 +11:00
// CraftBukkit end
2018-12-06 10:00:00 +11:00
PlayerConnection.LOGGER.warn("{} (vehicle of {}) moved too quickly! {},{},{}", entity.getDisplayName().getString(), this.player.getDisplayName().getString(), d6, d7, d8);
2016-03-26 14:16:36 +11:00
this.networkManager.sendPacket(new PacketPlayOutVehicleMove(entity));
2019-12-11 09:00:00 +11:00
@@ -908,7 +908,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
2019-06-21 20:00:00 +10:00
if (!this.player.H() && (!this.player.getWorldServer().getGameRules().getBoolean(GameRules.DISABLE_ELYTRA_MOVEMENT_CHECK) || !this.player.isGliding())) {
2019-04-23 12:00:00 +10:00
float f2 = this.player.isGliding() ? 300.0F : 100.0F;
2016-03-26 14:16:36 +11:00
2019-04-23 12:00:00 +10:00
- if (d11 - d10 > Math.max(f2, Math.pow((double) (10.0F * (float) i * speed), 2)) && !this.isExemptPlayer()) {
+ if (d11 - d10 > Math.max(f2, Math.pow((double) (org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed), 2)) && !this.isExemptPlayer()) {
2016-12-21 07:00:00 +11:00
// CraftBukkit end
2018-12-06 10:00:00 +11:00
PlayerConnection.LOGGER.warn("{} moved too quickly! {},{},{}", this.player.getDisplayName().getString(), d7, d8, d9);
2019-12-11 09:00:00 +11:00
this.a(this.player.locX(), this.player.locY(), this.player.locZ(), this.player.yaw, this.player.pitch);
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
2020-01-22 08:00:00 +11:00
index 7a2b8948c..5d37f976d 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
+ }
}
--
2019-04-23 09:33:25 +10:00
2.20.1
2016-03-01 08:33:06 +11:00