Skip to content

Commit dc7a2bf

Browse files
committed
filter interactions that collide with current pending interactions
1 parent f1776a5 commit dc7a2bf

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

common/src/main/kotlin/com/lambda/interaction/request/interacting/InteractionManager.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,9 @@ object InteractionManager : RequestHandler<InteractionRequest>(
106106

107107
private fun populateFrom(request: InteractionRequest) {
108108
setPendingConfigs(request)
109-
potentialInteractions = request.contexts.toMutableList()
109+
potentialInteractions = request.contexts
110+
.filter { pendingInteractions.none { pending -> pending.context.blockPos == it.blockPos } }
111+
.toMutableList()
110112

111113
val pendingLimit = (request.build.maxPendingInteractions - pendingPlacements.size).coerceAtLeast(0)
112114
maxInteractionsThisTick = (request.build.interactionsPerTick.coerceAtMost(pendingLimit))

0 commit comments

Comments
 (0)