2018-01-22 01:19:57 +11:00
From 91a2d6da5798147fb9d46d061782b7d2d0ca1817 Mon Sep 17 00:00:00 2001
2016-03-01 08:33:06 +11:00
From: Jonas Konrad <me@yawk.at>
Date: Tue, 22 Jul 2014 15:59:01 +0200
Subject: [PATCH] Make "moved too quickly" limit configurable
2016-03-26 14:16:36 +11:00
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
2017-11-17 10:24:35 +11:00
index 49b32c41a..150bb0816 100644
2016-03-26 14:16:36 +11:00
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
2017-09-18 20:00:00 +10:00
@@ -329,7 +329,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
2016-03-26 14:16:36 +11:00
}
speed *= 2f; // TODO: Get the speed of the vehicle instead of the player
2016-11-17 12:41:12 +11:00
- if (d10 - d9 > Math.max(100.0D, Math.pow((double) (10.0F * (float) i * speed), 2)) && (!this.minecraftServer.R() || !this.minecraftServer.Q().equals(entity.getName()))) {
+ if (d10 - d9 > Math.max(100.0D, Math.pow((double) (org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed), 2)) && (!this.minecraftServer.R() || !this.minecraftServer.Q().equals(entity.getName()))) { // Spigot
2016-03-26 14:16:36 +11:00
// CraftBukkit end
2017-05-14 12:00:00 +10:00
PlayerConnection.LOGGER.warn("{} (vehicle of {}) moved too quickly! {},{},{}", entity.getName(), this.player.getName(), Double.valueOf(d6), Double.valueOf(d7), Double.valueOf(d8));
2016-03-26 14:16:36 +11:00
this.networkManager.sendPacket(new PacketPlayOutVehicleMove(entity));
2017-09-18 20:00:00 +10:00
@@ -568,7 +568,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
2017-06-08 18:00:00 +10:00
if (!this.player.L() && (!this.player.x().getGameRules().getBoolean("disableElytraMovementCheck") || !this.player.cP())) {
float f2 = this.player.cP() ? 300.0F : 100.0F;
2016-03-26 14:16:36 +11:00
2016-12-21 07:00:00 +11:00
- if (d11 - d10 > Math.max(f2, Math.pow((double) (10.0F * (float) i * speed), 2)) && (!this.minecraftServer.R() || !this.minecraftServer.Q().equals(this.player.getName()))) {
+ if (d11 - d10 > Math.max(f2, Math.pow((double) (org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed), 2)) && (!this.minecraftServer.R() || !this.minecraftServer.Q().equals(this.player.getName()))) { // Spigot
// CraftBukkit end
2017-05-14 12:00:00 +10:00
PlayerConnection.LOGGER.warn("{} moved too quickly! {},{},{}", this.player.getName(), Double.valueOf(d7), Double.valueOf(d8), Double.valueOf(d9));
2016-12-21 07:00:00 +11:00
this.a(this.player.locX, this.player.locY, this.player.locZ, this.player.yaw, this.player.pitch);
2016-03-01 08:33:06 +11:00
diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java
2017-11-17 10:24:35 +11:00
index 32f0bb430..a34886c3c 100644
2016-03-01 08:33:06 +11:00
--- a/src/main/java/org/spigotmc/SpigotConfig.java
+++ b/src/main/java/org/spigotmc/SpigotConfig.java
2017-06-09 15:58:16 +10:00
@@ -340,4 +340,10 @@ public class SpigotConfig
2016-03-01 08:33:06 +11:00
{
movedWronglyThreshold = getDouble( "settings.moved-wrongly-threshold", 0.0625D );
}
+
2016-03-26 14:16:36 +11:00
+ public static double movedTooQuicklyMultiplier;
+ private static void movedTooQuicklyMultiplier()
2016-03-01 08:33:06 +11:00
+ {
2016-03-26 14:16:36 +11:00
+ movedTooQuicklyMultiplier = getDouble( "settings.moved-too-quickly-multiplier", 10.0D );
2016-03-01 08:33:06 +11:00
+ }
}
--
2017-11-10 10:52:45 +11:00
2.14.1
2016-03-01 08:33:06 +11:00