Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/main/kotlin/com/lambda/module/modules/render/Freecam.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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<PacketEvent.Receive.Pre> { event ->
val packet = event.packet
if (packet is PlayerRespawnS2CPacket) toggle()
}
}

private fun SafeContext.findFollowTarget(): PlayerEntity? {
Expand Down