Skip to content

Commit 012e4ec

Browse files
committed
Fix bricked loading screen on death while in freecam
1 parent e80368d commit 012e4ec

2 files changed

Lines changed: 12 additions & 7 deletions

File tree

src/main/java/com/lambda/mixin/render/WorldRendererMixin.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,4 +100,12 @@ boolean modHasBlindnessOrDarkness(boolean original) {
100100

101101
return original;
102102
}
103+
104+
@ModifyReturnValue(method = "isRenderingReady", at = @At("RETURN"))
105+
boolean modIsRenderingReady(boolean original) {
106+
if (Freecam.INSTANCE.isEnabled()) {
107+
return true;
108+
}
109+
return original;
110+
}
103111
}

src/main/kotlin/com/lambda/module/modules/player/Freecam.kt

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,7 @@ import net.minecraft.util.math.Vec3d
5858
object Freecam : Module(
5959
name = "Freecam",
6060
description = "Move your camera freely",
61-
tag = ModuleTag.RENDER,
62-
autoDisable = true,
61+
tag = ModuleTag.RENDER
6362
) {
6463
private val speed by setting("Speed", 0.5, 0.1..1.0, 0.1, "Freecam movement speed", unit = "m/s")
6564
private val sprint by setting("Sprint Multiplier", 3.0, 0.1..10.0, 0.1, description = "Set below 1.0 to fly slower on sprint.")
@@ -127,16 +126,14 @@ object Freecam : Module(
127126

128127
listen<PlayerEvent.World.Respawn> {
129128
loading = true
130-
info("Respawned, waiting for position look packet to update freecam position...")
131129
}
132130

133131
listen<PlayerEvent.World.SetPosition> {
134-
info("Received position look packet, updating freecam position")
135-
info("New position: ${it.position}")
136132
if (loading) {
137133
loading = false
138-
position = player.eyePos
139-
rotation = player.rotation
134+
position = it.position + player.standingEyeHeight
135+
rotation = Rotation(it.yaw, it.pitch)
136+
updateCam()
140137
}
141138
}
142139

0 commit comments

Comments
 (0)