mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-23 11:06:29 +01:00
39 lines
2.1 KiB
Diff
39 lines
2.1 KiB
Diff
From e69ef558ecb3e2bc989b8421d643234ab67be6f3 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 cd4f0c9..97037ff 100644
|
|
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
|
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
|
@@ -371,7 +371,8 @@ public class PlayerConnection implements PacketPlayInListener {
|
|
// CraftBukkit end
|
|
double d10 = d7 * d7 + d8 * d8 + d9 * d9;
|
|
|
|
- if (d10 > 100.0D && this.checkMovement && (!this.minecraftServer.N() || !this.minecraftServer.M().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 (d10 > org.spigotmc.SpigotConfig.movedTooQuicklyThreshold && this.checkMovement && (!this.minecraftServer.N() || !this.minecraftServer.M().equals(this.player.getName()))) { // CraftBukkit - Added this.checkMovement condition to solve this check being triggered by teleports
|
|
c.warn(this.player.getName() + " moved too quickly! " + d4 + "," + d5 + "," + d6 + " (" + d7 + ", " + d8 + ", " + d9 + ")");
|
|
this.a(this.y, this.z, 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 6a230f9..0a63291 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 );
|
|
+ }
|
|
}
|
|
--
|
|
1.9.1
|
|
|