From be29e0e574f96891440e739693178bab61705413 Mon Sep 17 00:00:00 2001 From: MukjepScarlet <93977077+MukjepScarlet@users.noreply.github.com> Date: Thu, 20 Feb 2025 18:40:56 +0800 Subject: [PATCH] feat: random sneak time in Scaffold GodBridge --- .../scaffold/techniques/ScaffoldGodBridgeTechnique.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/kotlin/net/ccbluex/liquidbounce/features/module/modules/world/scaffold/techniques/ScaffoldGodBridgeTechnique.kt b/src/main/kotlin/net/ccbluex/liquidbounce/features/module/modules/world/scaffold/techniques/ScaffoldGodBridgeTechnique.kt index 16a6c72d68f..424830e57f0 100644 --- a/src/main/kotlin/net/ccbluex/liquidbounce/features/module/modules/world/scaffold/techniques/ScaffoldGodBridgeTechnique.kt +++ b/src/main/kotlin/net/ccbluex/liquidbounce/features/module/modules/world/scaffold/techniques/ScaffoldGodBridgeTechnique.kt @@ -61,7 +61,7 @@ object ScaffoldGodBridgeTechnique : ScaffoldTechnique("GodBridge"), ScaffoldLedg private var mode by enumChoice("Mode", Mode.JUMP) private var forceSneakBelowCount by int("ForceSneakBelowCount", 3, 0..10) - private var sneakTime by int("SneakTime", 1, 1..10) + private val sneakTime by intRange("SneakTime", 1..1, 1..10) override fun ledge( target: BlockPlacementTarget?, @@ -103,16 +103,16 @@ object ScaffoldGodBridgeTechnique : ScaffoldTechnique("GodBridge"), ScaffoldLedg // we need to prevent the player from falling off the ledge e.g by jumping or sneaking. when { ModuleScaffold.blockCount < forceSneakBelowCount -> { - LedgeAction(sneakTime = this@ScaffoldGodBridgeTechnique.sneakTime) + LedgeAction(sneakTime = sneakTime.random()) } mode == Mode.JUMP -> LedgeAction(jump = true) - mode == Mode.SNEAK -> LedgeAction(sneakTime = this@ScaffoldGodBridgeTechnique.sneakTime) + mode == Mode.SNEAK -> LedgeAction(sneakTime = sneakTime.random()) mode == Mode.STOP_INPUT -> LedgeAction(stopInput = true) mode == Mode.BACKWARDS -> LedgeAction(stepBack = true) mode == Mode.RANDOM -> if (Random.nextBoolean()) { LedgeAction(jump = true, sneakTime = 0) } else { - LedgeAction(jump = false, sneakTime = this@ScaffoldGodBridgeTechnique.sneakTime) + LedgeAction(jump = false, sneakTime = sneakTime.random()) } else -> LedgeAction.NO_LEDGE }