mirror of
https://github.com/barkeser2002/Tenet.git
synced 2026-09-25 01:39:58 +03:00
47 lines
2.6 KiB
Diff
47 lines
2.6 KiB
Diff
From 33ac6382cfc9c5761f5231eb9d3f6af24240817f 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/network/PlayerConnection.java b/src/main/java/net/minecraft/server/network/PlayerConnection.java
|
|
index 912fa4b2f9..7d6da8d777 100644
|
|
--- a/src/main/java/net/minecraft/server/network/PlayerConnection.java
|
|
+++ b/src/main/java/net/minecraft/server/network/PlayerConnection.java
|
|
@@ -631,7 +631,7 @@ public class PlayerConnection implements ServerPlayerConnection, TickablePacketL
|
|
d10 = d6 * d6 + d7 * d7 + d8 * d8;
|
|
boolean flag2 = false;
|
|
|
|
- if (d10 > 0.0625D) {
|
|
+ if (d10 > org.spigotmc.SpigotConfig.movedWronglyThreshold) { // Spigot
|
|
flag2 = true;
|
|
PlayerConnection.LOGGER.warn("{} (vehicle of {}) moved wrongly! {}", new Object[]{entity.getName().getString(), this.player.getName().getString(), Math.sqrt(d10)});
|
|
}
|
|
@@ -1307,7 +1307,7 @@ public class PlayerConnection implements ServerPlayerConnection, TickablePacketL
|
|
d10 = d6 * d6 + d7 * d7 + d8 * d8;
|
|
boolean flag2 = false;
|
|
|
|
- if (!this.player.isChangingDimension() && d10 > 0.0625D && !this.player.isSleeping() && !this.player.gameMode.isCreative() && this.player.gameMode.getGameModeForPlayer() != EnumGamemode.SPECTATOR) {
|
|
+ if (!this.player.isChangingDimension() && d10 > org.spigotmc.SpigotConfig.movedWronglyThreshold && !this.player.isSleeping() && !this.player.gameMode.isCreative() && this.player.gameMode.getGameModeForPlayer() != EnumGamemode.SPECTATOR) { // Spigot
|
|
flag2 = true;
|
|
PlayerConnection.LOGGER.warn("{} moved wrongly!", this.player.getName().getString());
|
|
}
|
|
diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java
|
|
index 3540e2dafb..9e34d30271 100644
|
|
--- a/src/main/java/org/spigotmc/SpigotConfig.java
|
|
+++ b/src/main/java/org/spigotmc/SpigotConfig.java
|
|
@@ -326,4 +326,10 @@ public class SpigotConfig
|
|
{
|
|
saveUserCacheOnStopOnly = getBoolean( "settings.save-user-cache-on-stop-only", false );
|
|
}
|
|
+
|
|
+ public static double movedWronglyThreshold;
|
|
+ private static void movedWronglyThreshold()
|
|
+ {
|
|
+ movedWronglyThreshold = getDouble( "settings.moved-wrongly-threshold", 0.0625D );
|
|
+ }
|
|
}
|
|
--
|
|
2.41.0
|
|
|