@@ -70,15 +70,15 @@ object BreakManager : RequestHandler<BreakRequest>(), PositionBlocking {
7070 set(value) { breakingInfos[1 ] = value }
7171 private val breakingInfos = arrayOfNulls<BreakInfo >(2 )
7272
73- private val pendingInteractions = LimitedDecayQueue <BreakInfo >(
73+ private val pendingBreaks = LimitedDecayQueue <BreakInfo >(
7474 TaskFlowModule .build.maxPendingInteractions, TaskFlowModule .build.interactionTimeout * 50L
7575 ) {
7676 info(" ${it::class .simpleName} at ${it.context.expectedPos.toShortString()} timed out" )
7777 mc.world?.setBlockState(it.context.expectedPos, it.context.checkedState)
7878 }
7979
8080 override val blockedPositions
81- get() = breakingInfos.mapNotNull { it?.context?.expectedPos } + pendingInteractions .map { it.context.expectedPos }
81+ get() = breakingInfos.mapNotNull { it?.context?.expectedPos } + pendingBreaks .map { it.context.expectedPos }
8282
8383 private var rotation: RotationRequest ? = null
8484 private var validRotation = false
@@ -153,7 +153,7 @@ object BreakManager : RequestHandler<BreakRequest>(), PositionBlocking {
153153
154154 currentRequest?.let request@ { request ->
155155 val breakConfig = request.buildConfig.breakSettings
156- val takeCount = breakConfig.maxPendingBreaks - (breakingInfos.count { it != null } + pendingInteractions .size)
156+ val takeCount = breakConfig.maxPendingBreaks - (breakingInfos.count { it != null } + pendingBreaks .size)
157157 val validContexts = request.contexts
158158 .filter { ctx -> canAccept(ctx) }
159159 .sortedBy { it.instantBreak }
@@ -188,14 +188,14 @@ object BreakManager : RequestHandler<BreakRequest>(), PositionBlocking {
188188 }
189189
190190 listen<WorldEvent .BlockUpdate .Server > { event ->
191- pendingInteractions
191+ pendingBreaks
192192 .firstOrNull { it.context.expectedPos == event.pos }
193193 ?.let { pending ->
194194 // return if the state hasn't changed
195195 if (event.newState.matches(pending.context.checkedState))
196196 return @listen
197197
198- pendingInteractions .remove(pending)
198+ pendingBreaks .remove(pending)
199199 // return if the block's not broken
200200 if (! matchesTargetState(event.pos, pending.context.targetState, event.newState))
201201 return @listen
@@ -227,7 +227,7 @@ object BreakManager : RequestHandler<BreakRequest>(), PositionBlocking {
227227 // ToDo: Dependent on the tracked data order. When set stack is called after position it wont work
228228// listen<EntityEvent.EntityUpdate> {
229229// if (it.entity !is ItemEntity) return@listen
230- // pendingInteractions
230+ // pendingBreaks
231231// .firstOrNull { info -> matchesBlockItem(info, it.entity) }
232232// ?.onItemDrop?.invoke(it.entity)
233233// ?: breakingInfos
@@ -296,12 +296,12 @@ object BreakManager : RequestHandler<BreakRequest>(), PositionBlocking {
296296 }
297297
298298 private fun setPendingInteractionsLimits (buildConfig : BuildConfig ) {
299- pendingInteractions .setMaxSize(buildConfig.maxPendingInteractions)
300- pendingInteractions .setDecayTime(buildConfig.interactionTimeout * 50L )
299+ pendingBreaks .setMaxSize(buildConfig.maxPendingInteractions)
300+ pendingBreaks .setDecayTime(buildConfig.interactionTimeout * 50L )
301301 }
302302
303303 private fun SafeContext.canAccept (ctx : BreakContext ) =
304- pendingInteractions .none { it.context.expectedPos == ctx.expectedPos }
304+ pendingBreaks .none { it.context.expectedPos == ctx.expectedPos }
305305 && breakingInfos.none { info -> info?.context?.expectedPos == ctx.expectedPos }
306306 && ! blockState(ctx.expectedPos).isAir
307307
@@ -449,10 +449,10 @@ object BreakManager : RequestHandler<BreakRequest>(), PositionBlocking {
449449 }
450450 BreakConfirmationMode .BreakThenAwait -> {
451451 destroyBlock(info)
452- pendingInteractions .add(info)
452+ pendingBreaks .add(info)
453453 }
454454 BreakConfirmationMode .AwaitThenBreak -> {
455- pendingInteractions .add(info)
455+ pendingBreaks .add(info)
456456 }
457457 }
458458 info.nullify()
0 commit comments