spigot/CraftBukkit-Patches/0115-Make-moved-wrongly-limit-configurable.patch
2017-03-15 20:52:45 +11:00

46 lines
2.4 KiB
Diff

From 327b08c0fb09bee9d37a304d0b5a0c0b7868c9f3 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 b798c07..fc5a6b2 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -339,7 +339,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!", new Object[] { entity.getName()});
}
@@ -560,7 +560,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
d11 = d7 * d7 + d8 * d8 + d9 * d9;
boolean flag1 = false;
- if (!this.player.K() && d11 > 0.0625D && !this.player.isSleeping() && !this.player.playerInteractManager.isCreative() && this.player.playerInteractManager.getGameMode() != EnumGamemode.SPECTATOR) {
+ if (!this.player.K() && 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!", new Object[] { this.player.getName()});
}
diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java
index b86b602..8b18c38 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.9.3