PaperMC/CraftBukkit-Patches/0141-Make-moved-too-quickly-limit-configurable.patch
Zach Brown 19972e09b8 Update SpigotMC's patches
5a0150f586ed3eb15fe6f1f596d1a5a7d806f0f9 Fix ITEM_BREAK
e6a3911057bd94d8bd7021cbb4923fb84fb106d1 Upstream merge
d1cdcf8d4c3639f956474f02ed662517cffbe23e Remove old patch
068df64aeee368377e1673667bffc7a6dcf90554 Rebuild all patches
2014-11-30 16:16:48 -06:00

38 lines
2.2 KiB
Diff

From 128a4b57c967c09c499e381fbbe9578cd782ccaf Mon Sep 17 00:00:00 2001
From: Jonas Konrad <me@yawk.at>
Date: Tue, 22 Jul 2014 15:59:01 +0200
Subject: [PATCH] Make "moved too quickly" limit configurable
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index 3246c0f..9240aab 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -378,7 +378,8 @@ public class PlayerConnection implements PacketListenerPlayIn, IUpdatePlayerList
// CraftBukkit end
double d17 = d14 * d14 + d15 * d15 + d16 * d16;
- if (d17 > 100.0D && this.checkMovement && (!this.minecraftServer.S() || !this.minecraftServer.R().equals(this.player.getName()))) { // CraftBukkit - Added this.checkMovement condition to solve this check being triggered by teleports
+ // Spigot: make "moved too quickly" limit configurable
+ if (d17 > org.spigotmc.SpigotConfig.movedTooQuicklyThreshold && this.checkMovement && (!this.minecraftServer.S() || !this.minecraftServer.R().equals(this.player.getName()))) { // CraftBukkit - Added this.checkMovement condition to solve this check being triggered by teleports
PlayerConnection.c.warn(this.player.getName() + " moved too quickly! " + d11 + "," + d12 + "," + d13 + " (" + d14 + ", " + d15 + ", " + d16 + ")");
this.a(this.o, this.p, this.q, this.player.yaw, this.player.pitch);
return;
diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java
index 759a95a..8233de7 100644
--- a/src/main/java/org/spigotmc/SpigotConfig.java
+++ b/src/main/java/org/spigotmc/SpigotConfig.java
@@ -339,4 +339,10 @@ public class SpigotConfig
{
movedWronglyThreshold = getDouble( "settings.moved-wrongly-threshold", 0.0625D );
}
+
+ public static double movedTooQuicklyThreshold;
+ private static void movedTooQuicklyThreshold()
+ {
+ movedTooQuicklyThreshold = getDouble( "settings.moved-too-quickly-threshold", 100.0D );
+ }
}
--
2.1.0