spigot/CraftBukkit-Patches/0101-Make-moved-too-quickly-limit-configurable.patch

47 lines
3.3 KiB
Diff
Raw Normal View History

2018-11-14 14:20:34 +11:00
From 241e8ae469f5ca5c8a67e635d9ddd2debf0760ea 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
2018-11-14 14:20:34 +11:00
index 56a23a11f..6b66a9475 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
2018-10-27 17:44:13 +11:00
@@ -330,7 +330,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
2018-08-26 12:00:00 +10:00
- if (d10 - d9 > Math.max(100.0D, Math.pow((double) (10.0F * (float) i * speed), 2)) && (!this.minecraftServer.H() || !this.minecraftServer.G().equals(entity.getDisplayName().getString()))) {
+ if (d10 - d9 > Math.max(100.0D, Math.pow((double) (org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed), 2)) && (!this.minecraftServer.H() || !this.minecraftServer.G().equals(entity.getDisplayName().getString()))) {
2016-03-26 14:16:36 +11:00
// CraftBukkit end
2018-07-15 10:00:00 +10:00
PlayerConnection.LOGGER.warn("{} (vehicle of {}) moved too quickly! {},{},{}", entity.getDisplayName().getString(), this.player.getDisplayName().getString(), Double.valueOf(d6), Double.valueOf(d7), Double.valueOf(d8));
2016-03-26 14:16:36 +11:00
this.networkManager.sendPacket(new PacketPlayOutVehicleMove(entity));
2018-10-27 17:44:13 +11:00
@@ -862,7 +862,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
2018-07-22 12:00:00 +10:00
if (!this.player.H() && (!this.player.getWorldServer().getGameRules().getBoolean("disableElytraMovementCheck") || !this.player.dc())) {
float f2 = this.player.dc() ? 300.0F : 100.0F;
2016-03-26 14:16:36 +11:00
2018-08-26 12:00:00 +10:00
- if (d11 - d10 > Math.max(f2, Math.pow((double) (10.0F * (float) i * speed), 2)) && (!this.minecraftServer.H() || !this.minecraftServer.G().equals(this.player.getProfile().getName()))) {
+ if (d11 - d10 > Math.max(f2, Math.pow((double) (org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed), 2)) && (!this.minecraftServer.H() || !this.minecraftServer.G().equals(this.player.getProfile().getName()))) {
2016-12-21 07:00:00 +11:00
// CraftBukkit end
2018-07-15 10:00:00 +10:00
PlayerConnection.LOGGER.warn("{} moved too quickly! {},{},{}", this.player.getDisplayName().getString(), 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
2018-08-26 12:00:00 +10:00
index 97521a998..7dedebb7c 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
@@ -338,4 +338,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
+ }
}
--
2018-11-14 14:20:34 +11:00
2.19.1
2016-03-01 08:33:06 +11:00