testserver/CraftBukkit-Patches/0135-Make-moved-wrongly-lim...

39 lines
1.7 KiB
Diff
Raw Normal View History

2015-05-22 13:52:56 +00:00
From 9fc09c3b5b09ce4f86af0dbf88cf291e49a04e83 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-05-22 13:52:56 +00:00
index 9c1da26..b0e34c1 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
2015-05-22 13:52:56 +00:00
@@ -417,7 +417,8 @@ public class PlayerConnection implements PacketListenerPlayIn, IUpdatePlayerList
d15 = d11 * d11 + d12 * d12 + d13 * d13;
boolean flag1 = false;
2015-05-22 13:52:56 +00:00
- if (d15 > 0.0625D && !this.player.isSleeping() && !this.player.playerInteractManager.isCreative()) {
+ // Spigot: make "moved wrongly" limit configurable
+ if (d15 > org.spigotmc.SpigotConfig.movedWronglyThreshold && !this.player.isSleeping() && !this.player.playerInteractManager.isCreative()) {
flag1 = true;
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 );
+ }
}
--
2015-05-09 20:23:26 +00:00
2.1.4