|
|
|
|
@@ -0,0 +1,47 @@
|
|
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
|
From: adabugra <57899270+adabugra@users.noreply.github.com>
|
|
|
|
|
Date: Fri, 31 Jan 2025 19:17:01 +0300
|
|
|
|
|
Subject: [PATCH] Leaves Disable moved wrongly threshold
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
|
|
|
|
index 9c4f1ecf3327c000d48bbcb8f2720b366a0a587d..d949bd77b10722611280ce5930f06dd83174d587 100644
|
|
|
|
|
--- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
|
|
|
|
+++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
|
|
|
|
@@ -579,7 +579,7 @@ public class ServerGamePacketListenerImpl
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
// Paper end - Prevent moving into unloaded chunks
|
|
|
|
|
- if (d7 - d6 > Math.max(100.0, Math.pow((double) (org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed), 2)) && !this.isSingleplayerOwner()) {
|
|
|
|
|
+ if (!me.earthme.luminol.config.modules.misc.DisableMovedWronglyThreshold.enabled && d7 - d6 > Math.max(100.0, Math.pow((double) (org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed), 2)) && !this.isSingleplayerOwner()) { // Leaves - disable can
|
|
|
|
|
// CraftBukkit end
|
|
|
|
|
LOGGER.warn(
|
|
|
|
|
"{} (vehicle of {}) moved too quickly! {},{},{}", rootVehicle.getName().getString(), this.player.getName().getString(), d3, d4, d5
|
|
|
|
|
@@ -609,7 +609,7 @@ public class ServerGamePacketListenerImpl
|
|
|
|
|
d5 = d2 - rootVehicle.getZ();
|
|
|
|
|
d7 = d3 * d3 + d4 * d4 + d5 * d5;
|
|
|
|
|
boolean flag2 = false;
|
|
|
|
|
- if (d7 > org.spigotmc.SpigotConfig.movedWronglyThreshold) { // Spigot
|
|
|
|
|
+ if (!me.earthme.luminol.config.modules.misc.DisableMovedWronglyThreshold.enabled && d7 > org.spigotmc.SpigotConfig.movedWronglyThreshold) { // Spigot / Leaves - disable can
|
|
|
|
|
flag2 = true; // Paper - diff on change, this should be moved wrongly
|
|
|
|
|
LOGGER.warn("{} (vehicle of {}) moved wrongly! {}", rootVehicle.getName().getString(), this.player.getName().getString(), Math.sqrt(d7));
|
|
|
|
|
}
|
|
|
|
|
@@ -1434,7 +1434,7 @@ public class ServerGamePacketListenerImpl
|
|
|
|
|
|
|
|
|
|
if (this.shouldCheckPlayerMovement(isFallFlying)) {
|
|
|
|
|
float f2 = isFallFlying ? 300.0F : 100.0F;
|
|
|
|
|
- if (d7 - d6 > Math.max(f2, Mth.square(org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed))) {
|
|
|
|
|
+ if (!me.earthme.luminol.config.modules.misc.DisableMovedWronglyThreshold.enabled && d7 - d6 > Math.max(f2, Mth.square(org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed))) { // Leaves - disable can
|
|
|
|
|
// CraftBukkit end
|
|
|
|
|
// Paper start - Add fail move event
|
|
|
|
|
io.papermc.paper.event.player.PlayerFailMoveEvent event = fireFailMove(io.papermc.paper.event.player.PlayerFailMoveEvent.FailReason.MOVED_TOO_QUICKLY,
|
|
|
|
|
@@ -1506,7 +1506,8 @@ public class ServerGamePacketListenerImpl
|
|
|
|
|
d5 = d2 - this.player.getZ();
|
|
|
|
|
d7 = d3 * d3 + d4 * d4 + d5 * d5;
|
|
|
|
|
boolean movedWrongly = false; // Paper - Add fail move event; rename
|
|
|
|
|
- if (!this.player.isChangingDimension()
|
|
|
|
|
+ if (!me.earthme.luminol.config.modules.misc.DisableMovedWronglyThreshold.enabled // Leaves - disable can
|
|
|
|
|
+ && !this.player.isChangingDimension()
|
|
|
|
|
&& d7 > org.spigotmc.SpigotConfig.movedWronglyThreshold // Spigot
|
|
|
|
|
&& !this.player.isSleeping()
|
|
|
|
|
&& !this.player.gameMode.isCreative()
|