2016-11-17 12:41:12 +11:00
From 34b7e8374cff5d17c45bc193b2737b7731e00250 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
2016-11-17 12:41:12 +11:00
index 901ba86..15f2619 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
2016-11-17 12:41:12 +11:00
@@ -314,7 +314,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
2016-06-09 11:43:56 +10:00
PlayerConnection.LOGGER.warn("{} (vehicle of {}) moved too quickly! {},{},{}", new Object[] { 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));
2016-11-17 12:41:12 +11:00
@@ -523,7 +523,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
if (!this.player.K() && (!this.player.x().getGameRules().getBoolean("disableElytraMovementCheck") || !this.player.cH())) {
float f2 = this.player.cH() ? 300.0F : 100.0F;
2016-03-26 14:16:36 +11:00
2016-11-17 12:41:12 +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
2016-03-26 14:16:36 +11:00
// CraftBukkit end
2016-06-09 11:43:56 +10:00
PlayerConnection.LOGGER.warn("{} moved too quickly! {},{},{}", new Object[] { this.player.getName(), Double.valueOf(d7), Double.valueOf(d8), Double.valueOf(d9)});
2016-03-26 14:16:36 +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
2016-11-17 12:41:12 +11:00
index b683b88..4ef8fb1 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
@@ -340,4 +340,10 @@ public class SpigotConfig
{
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
+ }
}
--
2016-11-17 12:41:12 +11:00
2.9.3
2016-03-01 08:33:06 +11:00