Update Baritone assumeStep on change Up Step

Otherwise, it is not updated properly
This commit is contained in:
DifferentPerson 2021-03-02 17:28:13 -08:00
parent 840d3ad5c9
commit 53765f2b3c
1 changed files with 6 additions and 2 deletions

View File

@ -30,7 +30,7 @@ internal object Step : Module(
modulePriority = 200
) {
private val mode by setting("Mode", Mode.PACKET)
private val upStep = setting("Up Step", true)
private val upStep = setting("Up Step", true, consumer = { _, value -> setBaritoneAssumeStep(); value })
private val downStep = setting("Down Step", false)
private val entityStep by setting("Entities", true)
private val height by setting("Height", 1.0f, 0.25f..2.0f, 0.25f)
@ -61,7 +61,7 @@ internal object Step : Module(
}
onToggle {
BaritoneUtils.settings?.assumeStep?.value = it && upStep.value
setBaritoneAssumeStep()
}
listener<InputEvent.KeyInputEvent> {
@ -81,6 +81,10 @@ internal object Step : Module(
private fun BooleanSetting.toggleMsg() = "$chatName Turned ${this.name} ${if (this.value) "&aon" else "&coff"}&f!"
private fun setBaritoneAssumeStep() {
BaritoneUtils.settings?.assumeStep?.value = isEnabled && upStep.value
}
init {
safeListener<TickEvent.ClientTickEvent> {
if (it.phase != TickEvent.Phase.START || !shouldRunStep) return@safeListener