Skip to content

Commit 862ef05

Browse files
Add a timer "only when inputting" option (lambda-client#370)
* Add a timer "only when inputting option" * Fix setting name convention * Make timer pause in ClickGUI Co-authored-by: Constructor <fractalminds@protonmail.com>
1 parent 242e9d3 commit 862ef05

File tree

1 file changed

+11
-1
lines changed
  • src/main/kotlin/com/lambda/client/module/modules/player

1 file changed

+11
-1
lines changed

src/main/kotlin/com/lambda/client/module/modules/player/Timer.kt

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import com.lambda.client.manager.managers.TimerManager.modifyTimer
55
import com.lambda.client.manager.managers.TimerManager.resetTimer
66
import com.lambda.client.module.Category
77
import com.lambda.client.module.Module
8+
import com.lambda.client.module.modules.client.ClickGUI
9+
import com.lambda.client.util.MovementUtils
810
import net.minecraftforge.fml.common.gameevent.TickEvent
911

1012
object Timer : Module(
@@ -13,6 +15,7 @@ object Timer : Module(
1315
category = Category.PLAYER,
1416
modulePriority = 500
1517
) {
18+
private val onlyWhenInputting by setting("Only When Inputting", false)
1619
private val slow by setting("Slow Mode", false)
1720
private val tickNormal by setting("Tick N", 2.0f, 1f..10f, 0.1f, { !slow })
1821
private val tickSlow by setting("Tick S", 8f, 1f..10f, 0.1f, { slow })
@@ -25,8 +28,15 @@ object Timer : Module(
2528
listener<TickEvent.ClientTickEvent> {
2629
if (it.phase != TickEvent.Phase.END) return@listener
2730

31+
if (ClickGUI.isEnabled) {
32+
resetTimer()
33+
return@listener
34+
}
35+
2836
val multiplier = if (!slow) tickNormal else tickSlow / 10.0f
29-
modifyTimer(50.0f / multiplier)
37+
if (onlyWhenInputting) {
38+
if (MovementUtils.isInputting) modifyTimer(50.0f / multiplier)
39+
} else modifyTimer(50.0f / multiplier)
3040
}
3141
}
3242
}

0 commit comments

Comments
 (0)