3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-15 11:00:06 +01:00
Paper/CraftBukkit-Patches/0133-Make-moved-wrongly-limit-configurable.patch
2015-06-05 05:26:00 -07:00

39 Zeilen
1.7 KiB
Diff

From f6780bc97b1cbc9978014f36a98b6b86aabfd962 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
index aac4851..54bc1b0 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -417,7 +417,8 @@ public class PlayerConnection implements PacketListenerPlayIn, IUpdatePlayerList
d15 = d11 * d11 + d12 * d12 + d13 * d13;
boolean flag1 = false;
- 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
index 921d7d5..7e774f2 100644
--- a/src/main/java/org/spigotmc/SpigotConfig.java
+++ b/src/main/java/org/spigotmc/SpigotConfig.java
@@ -334,4 +334,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 );
+ }
}
--
2.1.4