File tree Expand file tree Collapse file tree 4 files changed +6
-6
lines changed
common/src/main/kotlin/com/lambda/interaction/request Expand file tree Collapse file tree 4 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,8 @@ package com.lambda.interaction.request
1919
2020import com.lambda.config.groups.BuildConfig
2121import com.lambda.event.events.ConnectionEvent
22+ import com.lambda.event.events.TickEvent
23+ import com.lambda.event.listener.SafeListener.Companion.listen
2224import com.lambda.event.listener.UnsafeListener.Companion.listenUnsafe
2325import com.lambda.interaction.request.breaking.BrokenBlockHandler
2426import com.lambda.util.collections.LimitedDecayQueue
@@ -27,6 +29,10 @@ abstract class PostActionHandler<T : ActionInfo> {
2729 abstract val pendingActions: LimitedDecayQueue <T >
2830
2931 init {
32+ listen<TickEvent .Pre >(priority = Int .MAX_VALUE ) {
33+ pendingActions.cleanUp()
34+ }
35+
3036 listenUnsafe<ConnectionEvent .Connect .Pre >(priority = Int .MIN_VALUE ) {
3137 pendingActions.clear()
3238 }
Original file line number Diff line number Diff line change @@ -256,8 +256,6 @@ object BreakManager : RequestHandler<BreakRequest>(
256256 * @see updateBreakProgress
257257 */
258258 private fun SafeContext.processRequest (breakRequest : BreakRequest ? ) {
259- pendingActions.cleanUp()
260-
261259 repeat(2 ) {
262260 breakRequest?.let { request ->
263261 if (request.fresh) populateFrom(request)
Original file line number Diff line number Diff line change @@ -83,8 +83,6 @@ object InteractionManager : RequestHandler<InteractRequest>(
8383 }
8484
8585 fun SafeContext.processRequest (request : InteractRequest ) {
86- pendingActions.cleanUp()
87-
8886 if (request.fresh) populateFrom(request)
8987
9088 if (player.isSneaking) return
Original file line number Diff line number Diff line change @@ -135,8 +135,6 @@ object PlaceManager : RequestHandler<PlaceRequest>(
135135 * @see placeBlock
136136 */
137137 fun SafeContext.processRequest (request : PlaceRequest ) {
138- pendingActions.cleanUp()
139-
140138 if (request.fresh) populateFrom(request)
141139
142140 val iterator = potentialPlacements.iterator()
You can’t perform that action at this time.
0 commit comments