1717
1818package com.lambda.module.modules.player
1919
20- import com.lambda.config.AutomationConfig.Companion.setDefaultAutomationConfig
20+ import com.lambda.config.AutomationConfig.Companion.automationConfig
2121import com.lambda.config.applyEdits
22- import com.lambda.config.groups.BuildConfig
2322import com.lambda.event.events.PlayerEvent
2423import com.lambda.event.events.TickEvent
2524import com.lambda.event.listener.SafeListener.Companion.listen
2625import com.lambda.interaction.construction.context.BuildContext
2726import com.lambda.interaction.construction.result.results.BreakResult
2827import com.lambda.interaction.construction.simulation.BuildSimulator.simulate
2928import com.lambda.interaction.construction.verify.TargetState
30- import com.lambda.interaction.request.breaking.BreakConfig
3129import com.lambda.interaction.request.breaking.BreakRequest.Companion.breakRequest
32- import com.lambda.interaction.request.hotbar.HotbarConfig
3330import com.lambda.module.Module
3431import com.lambda.module.tag.ModuleTag
3532import com.lambda.threading.runSafeAutomated
@@ -40,55 +37,43 @@ object FastBreak : Module(
4037 description = " Break blocks faster." ,
4138 tag = ModuleTag .PLAYER ,
4239) {
43- private val pendingInteractions = ConcurrentLinkedQueue <BuildContext >()
44-
45- override val buildConfig = object : BuildConfig by super .buildConfig {
46- override val pathing = false
47- override val stayInRange = false
48- override val interactionsPerTick = 1
49- override val useDefaultReach = false
50- override val interactReach = Double .MAX_VALUE
51- override val checkSideVisibility = false
52- override val strictRayCast = false
40+ override var defaultAutomationConfig = automationConfig {
41+ applyEdits {
42+ hideAllGroupsExcept(breakConfig, rotationConfig, hotbarConfig)
43+ buildConfig.apply {
44+ editTyped(
45+ ::pathing,
46+ ::stayInRange,
47+ ::useDefaultReach,
48+ ::checkSideVisibility,
49+ ::strictRayCast
50+ ) { defaultValue(false ) }
51+ ::interactionsPerTick.edit { defaultValue(1 ) }
52+ ::interactReach.edit { defaultValue(Double .MAX_VALUE ) }
53+ }
54+ breakConfig.apply {
55+ editTyped(
56+ ::avoidLiquids,
57+ ::avoidSupporting,
58+ ::efficientOnly,
59+ ::suitableToolsOnly
60+ ) { defaultValue(false ) }
61+ editTyped(
62+ ::rotateForBreak,
63+ ::doubleBreak
64+ ) { defaultValue(false ); hide() }
65+ ::breaksPerTick.edit { defaultValue(1 ); hide() }
66+ ::tickStageMask.edit { defaultValue(mutableSetOf (TickEvent .Input .Post )); hide() }
67+ ::maxPendingBreaks.edit { defaultValue(Int .MAX_VALUE ); hide() }
68+ hide(::sorter, ::unsafeCancels)
69+ }
70+ hotbarConfig::tickStageMask.edit { defaultValue(mutableSetOf (TickEvent .Input .Post )); hide() }
71+ }
5372 }
5473
55- override val breakConfig = object : BreakConfig by super .breakConfig {
56- override val rotateForBreak = false
57- override val doubleBreak = false
58- override val breaksPerTick = 1
59- override val tickStageMask = setOf (TickEvent .Input .Post )
60- override val maxPendingBreaks = Int .MAX_VALUE
61- }
62-
63- override val hotbarConfig = object : HotbarConfig by super .hotbarConfig {
64- override val tickStageMask = setOf (TickEvent .Input .Post )
65- }
74+ private val pendingInteractions = ConcurrentLinkedQueue <BuildContext >()
6675
6776 init {
68- setDefaultAutomationConfig {
69- applyEdits {
70- breakConfig.apply {
71- editTyped(
72- ::avoidLiquids,
73- ::avoidSupporting,
74- ::efficientOnly,
75- ::suitableToolsOnly
76- ) { defaultValue(false ) }
77- hide(
78- ::rotateForBreak,
79- ::doubleBreak,
80- ::breaksPerTick,
81- ::sorter,
82- ::unsafeCancels,
83- ::tickStageMask,
84- ::maxPendingBreaks
85- )
86- }
87- hide(hotbarConfig::tickStageMask)
88- hideAllGroupsExcept(breakConfig, rotationConfig, hotbarConfig)
89- }
90- }
91-
9277 listen<PlayerEvent .Attack .Block > { it.cancel() }
9378 listen<PlayerEvent .Breaking .Update > { event ->
9479 event.cancel()
0 commit comments