From 1bcc0f4e071dffa25732e1ff3e4e785eb86547f3 Mon Sep 17 00:00:00 2001 From: Vadim Totok <112573798+VadimTotok@users.noreply.github.com> Date: Tue, 5 May 2026 19:26:39 +0300 Subject: [PATCH] disable freecam on dimension change prevents a freeze caused by conflicts between Freecam logic and world reinitialization during teleportation --- .../kotlin/com/lambda/module/modules/render/Freecam.kt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/kotlin/com/lambda/module/modules/render/Freecam.kt b/src/main/kotlin/com/lambda/module/modules/render/Freecam.kt index 959dd43ce..ea23ddf72 100644 --- a/src/main/kotlin/com/lambda/module/modules/render/Freecam.kt +++ b/src/main/kotlin/com/lambda/module/modules/render/Freecam.kt @@ -22,6 +22,7 @@ import com.lambda.config.AutomationConfig.Companion.setDefaultAutomationConfig import com.lambda.config.applyEdits import com.lambda.context.SafeContext import com.lambda.event.events.MovementEvent +import com.lambda.event.events.PacketEvent import com.lambda.event.events.PlayerEvent import com.lambda.event.events.RenderEvent import com.lambda.event.events.TickEvent @@ -55,6 +56,7 @@ import com.lambda.util.world.raycast.RayCastUtils.orMiss import net.minecraft.client.network.ClientPlayerEntity import net.minecraft.client.option.Perspective import net.minecraft.entity.player.PlayerEntity +import net.minecraft.network.packet.s2c.play.PlayerRespawnS2CPacket import net.minecraft.util.hit.BlockHitResult import net.minecraft.util.hit.HitResult import net.minecraft.util.math.BlockPos @@ -228,6 +230,11 @@ object Freecam : Module( mc.crosshairTarget = rotation.rayCast(reach, lerpPos).orMiss // Can't be null (otherwise mc will spam "Null returned as 'hitResult', this shouldn't happen!") mc.crosshairTarget?.let { if (it.type != HitResult.Type.MISS) event.cancel() } } + + listen { event -> + val packet = event.packet + if (packet is PlayerRespawnS2CPacket) toggle() + } } private fun SafeContext.findFollowTarget(): PlayerEntity? {