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 Co-authored by: violetc <58360096+s-yh-china@users.noreply.github.com> As part of: Leaves (https://github.com/LeavesMC/Leaves/blob/f553c53e4230aa032e54a69b6479f1959ed24a60/patches/removed/server/0099-Disable-moved-wrongly-threshold.patch) Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html) diff --git a/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/net/minecraft/server/network/ServerGamePacketListenerImpl.java index cd873b03c553ba42b85b6165f99f5d4fba34ec3b..5d73af703975ab2410a399f392d0e0d1e78bd34d 100644 --- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -614,7 +614,7 @@ public class ServerGamePacketListenerImpl return; } // Paper end - Prevent moving into unloaded chunks - if (d7 - d6 > Math.max(100.0, Mth.square(org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed)) && !this.isSingleplayerOwner()) { + if (!me.earthme.luminol.config.modules.misc.DisableMovedWronglyThreshold.enabled && d7 - d6 > Math.max(100.0, Mth.square(org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed)) && !this.isSingleplayerOwner()) { // Leaves - disable can // CraftBukkit end LOGGER.warn( "{} (vehicle of {}) moved too quickly! {},{},{}", rootVehicle.getName().getString(), this.player.getName().getString(), d3, d4, d5 @@ -644,7 +644,7 @@ public class ServerGamePacketListenerImpl d5 = d2 - rootVehicle.getZ(); d7 = d3 * d3 + d4 * d4 + d5 * d5; boolean flag1 = false; - if (d7 > org.spigotmc.SpigotConfig.movedWronglyThreshold) { // Spigot + if (!me.earthme.luminol.config.modules.misc.DisableMovedWronglyThreshold.enabled && d7 > org.spigotmc.SpigotConfig.movedWronglyThreshold) { // Spigot flag1 = 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)); } @@ -1533,7 +1533,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, @@ -1607,7 +1607,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.isCreative()