Skip to content

Commit

Permalink
feat: added freelook autof5 option
Browse files Browse the repository at this point in the history
  • Loading branch information
opZywl committed Jan 2, 2025
1 parent f472a88 commit 07ce70f
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,19 @@
*/
package net.ccbluex.liquidbounce.features.module.modules.visual

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
import net.ccbluex.liquidbounce.features.module.Module
import net.ccbluex.liquidbounce.utils.rotation.Rotation
import net.ccbluex.liquidbounce.utils.extensions.prevRotation
import net.ccbluex.liquidbounce.utils.extensions.rotation
import net.ccbluex.liquidbounce.utils.rotation.Rotation

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

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.VISUAL) {

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 07ce70f

Please sign in to comment.