Skip to content

Commit

Permalink
feat(legacy): added freelook autof5 option (CCBlueX#5127)
Browse files Browse the repository at this point in the history
  • Loading branch information
EclipsesDev authored Dec 31, 2024
1 parent 9bf13ed commit d50626e
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/
package net.ccbluex.liquidbounce.features.module.modules.render

import net.ccbluex.liquidbounce.config.boolean
import net.ccbluex.liquidbounce.event.RotationSetEvent
import net.ccbluex.liquidbounce.event.handler
import net.ccbluex.liquidbounce.features.module.Category
Expand All @@ -15,6 +16,8 @@ import net.ccbluex.liquidbounce.utils.rotation.Rotation

object FreeLook : Module("FreeLook", Category.RENDER) {

private val autoF5 by boolean("AutoF5", true, subjective = true)

// The module's rotations
private var currRotation = Rotation.ZERO
private var prevRotation = currRotation
Expand All @@ -27,11 +30,19 @@ object FreeLook : Module("FreeLook", Category.RENDER) {

override fun onEnable() {
mc.thePlayer?.run {
if (autoF5 && mc.gameSettings.thirdPersonView != 1) {
mc.gameSettings.thirdPersonView = 1
}

currRotation = rotation
prevRotation = prevRotation
}
}

override fun onDisable() {
if (autoF5) mc.gameSettings.thirdPersonView = 0
}

val onRotationSet = handler<RotationSetEvent> { event ->
if (mc.gameSettings.thirdPersonView != 0) {
event.cancelEvent()
Expand Down

0 comments on commit d50626e

Please sign in to comment.