Skip to content

Commit

Permalink
fix: duplicated rotation settings in Scaffold
Browse files Browse the repository at this point in the history
  • Loading branch information
opZywl committed Jan 21, 2025
1 parent 2561c0e commit abcb153
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 36 deletions.
4 changes: 3 additions & 1 deletion src/main/java/net/ccbluex/liquidbounce/FDPClient.kt
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,9 @@ object FDPClient {
isStarting = false

if (!FileManager.firstStart && FileManager.backedup) {
MiscUtils.showMessageDialog("Warning: backup triggered", "Client update detected! Please check the config folder.")
SharedScopes.IO.launch {
MiscUtils.showMessageDialog("Warning: backup triggered", "Client update detected! Please check the config folder.")
}
}

EventManager.call(StartupEvent)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ object BlocksMC : FlyMode("BlocksMC"), Listenable {
if (player.onGround && stopOnLanding) {
if (debugFly)
chat("Ground Detected.. Stopping Fly")
Fly.state = false
Flight.state = false
}

if (!player.isMoving && stopOnNoMove) {
if (debugFly)
chat("No Movement Detected.. Stopping Fly. (Could be flagged)")
Fly.state = false
Flight.state = false
}
}

Expand Down Expand Up @@ -95,7 +95,7 @@ object BlocksMC : FlyMode("BlocksMC"), Listenable {
}

val onWorld = handler<WorldEvent> {
Fly.state = false
Flight.state = false
}

private fun handleTimerSlow(player: EntityPlayerSP) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ package net.ccbluex.liquidbounce.features.module.modules.other

import net.ccbluex.liquidbounce.features.module.Category
import net.ccbluex.liquidbounce.features.module.Module
import net.ccbluex.liquidbounce.utils.extensions.rotation
import net.ccbluex.liquidbounce.utils.rotation.Rotation
import net.ccbluex.liquidbounce.utils.rotation.RotationSettings
import net.ccbluex.liquidbounce.utils.rotation.RotationUtils.currentRotation
import net.ccbluex.liquidbounce.utils.rotation.RotationUtils.setTargetRotation
import net.ccbluex.liquidbounce.utils.extensions.rotation
import net.ccbluex.liquidbounce.utils.timing.WaitTickUtils
import net.minecraft.entity.player.EntityPlayer

Expand All @@ -22,12 +22,12 @@ object NoRotateSet : Module("NoRotateSet", Category.OTHER, gameDetecting = false
val affectRotation by boolean("AffectRotation", true)

private val ticksUntilStart = intRange("TicksUntilStart", 0..0, 0..20) { affectRotation }

private val options = RotationSettings(this) { affectRotation }.apply {
withoutKeepRotation()
rotationsValue.excludeWithState(true)
applyServerSideValue.excludeWithState(true)
resetTicksValue.excludeWithState(1)

withoutKeepRotation()
}

fun shouldModify(player: EntityPlayer) = handleEvents() && (!ignoreOnSpawn || player.ticksExisted != 0)
Expand All @@ -37,7 +37,6 @@ object NoRotateSet : Module("NoRotateSet", Category.OTHER, gameDetecting = false

currentRotation = player.rotation

// This connects with the SimulateShortStop code, [performAngleChange] function.
WaitTickUtils.schedule(ticksUntilStart.random, this)

setTargetRotation(savedRotation, options = options)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,19 +83,7 @@ object Scaffold : Module("Scaffold", Category.PLAYER, Keyboard.KEY_V) {
// Extra clicks
private val extraClicks by boolean("DoExtraClicks", false)
private val simulateDoubleClicking by boolean("SimulateDoubleClicking", false) { extraClicks }
private val extraClickMaxCPSValue: Value<Int> = int("ExtraClickMaxCPS", 7, 0..50) {
extraClicks
}.onChange { _, new ->
new.coerceAtLeast(extraClickMinCPS)
}
private val extraClickMaxCPS by extraClickMaxCPSValue

private val extraClickMinCPS by int("ExtraClickMinCPS", 3, 0..50) {
extraClicks
}.onChange { _, new ->
new.coerceAtMost(extraClickMaxCPS)
}

private val extraClickCPS by intRange("ExtraClickCPS", 3..7, 0..50) { extraClicks }
private val placementAttempt by choices(
"PlacementAttempt", arrayOf("Fail", "Independent"), "Fail"
) { extraClicks }
Expand Down Expand Up @@ -253,7 +241,7 @@ object Scaffold : Module("Scaffold", Category.PLAYER, Keyboard.KEY_V) {
get() = RotationUtils.currentRotation ?: mc.thePlayer.rotation

// Extra clicks
private var extraClick = ExtraClickInfo(TimeUtils.randomClickDelay(extraClickMinCPS, extraClickMaxCPS), 0L, 0)
private var extraClick = ExtraClickInfo(TimeUtils.randomClickDelay(extraClickCPS.first, extraClickCPS.last), 0L, 0)

// GodBridge
private var blocksPlacedUntilJump = 0
Expand Down Expand Up @@ -811,7 +799,7 @@ object Scaffold : Module("Scaffold", Category.PLAYER, Keyboard.KEY_V) {

if (raytrace.typeOfHit.isBlock && timePassed) {
extraClick = ExtraClickInfo(
TimeUtils.randomClickDelay(extraClickMinCPS, extraClickMaxCPS),
TimeUtils.randomClickDelay(extraClickCPS.first, extraClickCPS.last),
System.currentTimeMillis(),
extraClick.clicks + 1
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,8 @@ open class RotationSettings(owner: Module, generalApply: () -> Boolean = { true
open val strictValue = boolean("Strict", false) { strafeValue.isActive() && generalApply() }
open val keepRotationValue = boolean("KeepRotation", true) { rotationsActive && applyServerSide && generalApply() }

open val resetTicksValue: Value<Int> = int("ResetTicks", 1, 1..20) {
open val resetTicksValue = int("ResetTicks", 1, 1..20) {
rotationsActive && applyServerSide && keepRotation && generalApply()
}.onChange { _, new ->
new.coerceAtLeast(1) // minimum
}

open val legitimizeValue = boolean("Legitimize", false) { rotationsActive && generalApply() }
Expand All @@ -41,8 +39,6 @@ open class RotationSettings(owner: Module, generalApply: () -> Boolean = { true

open val angleResetDifferenceValue = float("AngleResetDifference", 5f.withGCD(), 0.0f..180f) {
rotationsActive && applyServerSide && generalApply()
}.onChange { _, new ->
new.withGCD().coerceIn(0.0f..180f) // range
}

open val minRotationDifferenceValue = float(
Expand Down Expand Up @@ -82,10 +78,8 @@ open class RotationSettings(owner: Module, generalApply: () -> Boolean = { true
val verticalSpeed
get() = verticalAngleChange.random()

fun withoutKeepRotation(): RotationSettings {
fun withoutKeepRotation() = apply {
keepRotationValue.excludeWithState()

return this
}

fun updateSimulateShortStopData(diff: Float) {
Expand Down Expand Up @@ -122,12 +116,8 @@ class RotationSettingsWithRotationModes(

val rotationModeValue = listValue.setSupport { generalApply() }

val rotationMode by rotationModeValue
val rotationMode by +rotationModeValue

override val rotationsActive: Boolean
get() = rotationMode != "Off"

init {
owner.addValues(this.values)
}
}

0 comments on commit abcb153

Please sign in to comment.