Skip to content

Commit bea07d3

Browse files
committed
public blocked positions in place and break managers
1 parent 506a31d commit bea07d3

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

common/src/main/kotlin/com/lambda/interaction/request/breaking/BreakManager.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ object BreakManager : RequestHandler<BreakRequest>() {
6969
TaskFlowModule.build.maxPendingInteractions, TaskFlowModule.build.interactionTimeout * 50L
7070
) { info("${it::class.simpleName} at ${it.context.expectedPos.toShortString()} timed out") }
7171

72+
val blockedPositions
73+
get() = breakingInfos.mapNotNull { it?.context?.expectedPos } + pendingInteractions.map { it.context.expectedPos }
74+
7275
private var blockBreakingCooldown = 0
7376

7477
private var rotation: RotationRequest? = null
@@ -175,7 +178,7 @@ object BreakManager : RequestHandler<BreakRequest>() {
175178
}
176179

177180
//ToDo: drop callback stuff
178-
// // ToDo: Dependent on the tracked data order. When set stack is called after position it wont work
181+
// ToDo: Dependent on the tracked data order. When set stack is called after position it wont work
179182
// listen<EntityEvent.EntityUpdate> {
180183
// if (it.entity !is ItemEntity) return@listen
181184
// pendingInteractions

common/src/main/kotlin/com/lambda/interaction/request/placing/PlaceManager.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ object PlaceManager : RequestHandler<PlaceRequest>() {
6060

6161
private var rotation: RotationRequest? = null
6262

63+
val blockedPositions
64+
get() = pendingInteractions.map { it.context.expectedPos }
65+
6366
init {
6467
onRotate(priority = Int.MIN_VALUE) {
6568
preEvent()

0 commit comments

Comments
 (0)