papermc/CraftBukkit-Patches/0136-Make-moved-wrongly-limit-configurable.patch

39 lines
1.7 KiB
Diff
Raw Normal View History

2015-03-08 11:04:41 +00:00
From 03b75ce178b9997862c4d2c31cb506d5665ec0ed Mon Sep 17 00:00:00 2001
From: Jonas Konrad <me@yawk.at>
Date: Fri, 4 Jul 2014 23:03:13 +0200
Subject: [PATCH] Make "moved wrongly" limit configurable
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
2015-02-28 11:36:22 +00:00
index b4b3cbc..2e5a55d 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
2015-02-28 11:36:22 +00:00
@@ -416,7 +416,8 @@ public class PlayerConnection implements PacketListenerPlayIn, IUpdatePlayerList
2014-11-28 01:17:45 +00:00
d17 = d11 * d11 + d12 * d12 + d13 * d13;
boolean flag1 = false;
2014-11-28 01:17:45 +00:00
- if (d17 > 0.0625D && !this.player.isSleeping() && !this.player.playerInteractManager.isCreative()) {
+ // Spigot: make "moved wrongly" limit configurable
2014-11-28 01:17:45 +00:00
+ if (d17 > org.spigotmc.SpigotConfig.movedWronglyThreshold && !this.player.isSleeping() && !this.player.playerInteractManager.isCreative()) {
flag1 = true;
2014-11-28 01:17:45 +00:00
PlayerConnection.c.warn(this.player.getName() + " moved wrongly!");
}
diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java
2014-11-28 01:17:45 +00:00
index c5e995b..759a95a 100644
--- a/src/main/java/org/spigotmc/SpigotConfig.java
+++ b/src/main/java/org/spigotmc/SpigotConfig.java
@@ -333,4 +333,10 @@ public class SpigotConfig
{
intCacheLimit = getInt( "settings.int-cache-limit", 1024 );
}
+
+ public static double movedWronglyThreshold;
+ private static void movedWronglyThreshold()
+ {
+ movedWronglyThreshold = getDouble( "settings.moved-wrongly-threshold", 0.0625D );
+ }
}
--
2014-11-28 01:17:45 +00:00
2.1.0