@@ -27,6 +27,7 @@ import com.lambda.interaction.construction.verify.TargetState
2727import com.lambda.interaction.request.RequestHandler
2828import com.lambda.interaction.request.breaking.BreakConfig.BreakConfirmationMode
2929import com.lambda.interaction.request.breaking.BreakConfig.BreakMode
30+ import com.lambda.interaction.request.hotbar.HotbarRequest
3031import com.lambda.interaction.request.rotation.RotationConfig
3132import com.lambda.interaction.request.rotation.RotationManager.onRotate
3233import com.lambda.module.modules.client.TaskFlowModule
@@ -69,24 +70,23 @@ object BreakManager : RequestHandler<BreakRequest>() {
6970 return @listen
7071 }
7172
72- if (updateRequest(false ) { true }) {
73+ var swapped = false
74+
75+ if (updateRequest(true ) { true }) {
7376 currentRequest?.let request@ { request ->
7477 var instaBreaks = 0
7578 request.contexts
7679 .sortedBy { it.instantBreak }
7780 .forEach { requestCtx ->
78- if (! canAccept(requestCtx)) {
79- return @forEach
80- }
81- val breakType = handleRequestContext(
82- requestCtx,
83- request.onBreak,
84- request.buildConfig,
85- request.rotationConfig
86- )
81+ if (! canAccept(requestCtx)) return @forEach
82+ val breakType = handleRequestContext(requestCtx, request.onBreak, request.buildConfig, request.rotationConfig)
8783 if (breakType == BreakType .Null ) return @request
8884 if (requestCtx.instantBreak && instaBreaks < request.buildConfig.breakSettings.breaksPerTick) {
8985 breakingInfos.getOrNull(breakType.index)?.let { info ->
86+ if (! swapped) {
87+ request.hotbarConfig.request(HotbarRequest (info.context.hotbarIndex))
88+ swapped = true
89+ }
9090 updateBlockBreakingProgress(info, player.mainHandStack)
9191 instaBreaks++
9292 }
@@ -95,6 +95,13 @@ object BreakManager : RequestHandler<BreakRequest>() {
9595 }
9696 }
9797
98+ currentRequest?.let { request ->
99+ breakingInfos.firstOrNull()?.let { info ->
100+ if (! swapped && ! request.hotbarConfig.request(HotbarRequest (info.context.hotbarIndex)).done)
101+ return @listen
102+ }
103+ }
104+
98105 breakingInfos.reversed().filterNotNull().forEach { info ->
99106 if (info.breakConfig.rotateForBreak && ! info.context.rotation.done) return @listen
100107 updateBlockBreakingProgress(info, player.mainHandStack)
0 commit comments