spigot/CraftBukkit-Patches/0113-Make-moved-wrongly-limit-configurable.patch

46 lines
2.4 KiB
Diff

From 904fc1546e7bb7096d39445665a490fe42a3226b 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 c58e9a84e..861ffca33 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -347,7 +347,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
d10 = d6 * d6 + d7 * d7 + d8 * d8;
boolean flag1 = false;
- if (d10 > 0.0625D) {
+ if (d10 > org.spigotmc.SpigotConfig.movedWronglyThreshold) { // Spigot
flag1 = true;
PlayerConnection.LOGGER.warn("{} moved wrongly!", entity.getName());
}
@@ -592,7 +592,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
d11 = d7 * d7 + d8 * d8 + d9 * d9;
boolean flag1 = false;
- if (!this.player.L() && d11 > 0.0625D && !this.player.isSleeping() && !this.player.playerInteractManager.isCreative() && this.player.playerInteractManager.getGameMode() != EnumGamemode.SPECTATOR) {
+ if (!this.player.L() && d11 > org.spigotmc.SpigotConfig.movedWronglyThreshold && !this.player.isSleeping() && !this.player.playerInteractManager.isCreative() && this.player.playerInteractManager.getGameMode() != EnumGamemode.SPECTATOR) { // Spigot
flag1 = true;
PlayerConnection.LOGGER.warn("{} moved wrongly!", this.player.getName());
}
diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java
index 2ae55b01a..32f0bb430 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.11.0