@@ -35,7 +35,6 @@ import com.lambda.interaction.managers.breaking.BreakManager
3535import com.lambda.interaction.managers.hotbar.HotbarRequest
3636import com.lambda.interaction.managers.interacting.InteractConfig.AirPlaceMode
3737import com.lambda.interaction.managers.interacting.InteractManager.activeRequest
38- import com.lambda.interaction.managers.interacting.InteractManager.maxPlacementsThisTick
3938import com.lambda.interaction.managers.interacting.InteractManager.populateFrom
4039import com.lambda.interaction.managers.interacting.InteractManager.processRequest
4140import com.lambda.interaction.managers.interacting.InteractedBlockHandler.pendingActions
@@ -73,10 +72,8 @@ object InteractManager : Manager<InteractRequest>(
7372 private var potentialInteractions = mutableListOf<InteractContext >()
7473
7574 private var interactCooldown = 0
76- private var placementsThisTick = 0
77- private var maxPlacementsThisTick = 0
78-
79- private var airPlacedThisTick = false
75+ private var interactionsThisTick = 0
76+ private var maxInteractionsThisTick = 0
8077
8178 private var shouldSneak = false
8279 private val ClientPlayerEntity .validSneak get() = isSneaking == shouldSneak
@@ -89,8 +86,7 @@ object InteractManager : Manager<InteractRequest>(
8986
9087 listen<TickEvent .Post >({ Int .MIN_VALUE }) {
9188 activeRequest = null
92- airPlacedThisTick = false
93- placementsThisTick = 0
89+ interactionsThisTick = 0
9490 potentialInteractions.clear()
9591 if (interactCooldown > 0 ) {
9692 interactCooldown--
@@ -118,7 +114,7 @@ object InteractManager : Manager<InteractRequest>(
118114 * @see processRequest
119115 */
120116 override fun AutomatedSafeContext.handleRequest (request : InteractRequest ) {
121- if (! request.buildConfig.interactBlocks || activeRequest != null || request.contexts.isEmpty()) return
117+ if (activeRequest != null || request.contexts.isEmpty()) return
122118 if (BreakManager .activeThisTick) return
123119
124120 activeRequest = request
@@ -127,14 +123,14 @@ object InteractManager : Manager<InteractRequest>(
127123 activeRequest = null
128124 potentialInteractions = mutableListOf ()
129125 }
130- if (placementsThisTick > 0 ) activeThisTick = true
126+ if (interactionsThisTick > 0 ) activeThisTick = true
131127 }
132128
133129 /* *
134130 * Returns immediately if [BreakManager] or [InteractManager] have been active this tick.
135131 * Otherwise, for fresh requests, [populateFrom] is called to fill the [potentialInteractions] collection.
136132 * It then attempts to perform as many placements as possible from the [potentialInteractions] collection within
137- * the [maxPlacementsThisTick ] limit.
133+ * the [maxInteractionsThisTick ] limit.
138134 *
139135 * @see populateFrom
140136 */
@@ -188,7 +184,6 @@ object InteractManager : Manager<InteractRequest>(
188184
189185 if (actionResult.isAccepted) {
190186 PacketLimitHandler .sentPackets(1 , PacketType .Interaction )
191- airPlacedThisTick = true
192187 if (interactConfig.swing) {
193188 swingHand(interactConfig.swingType, Hand .MAIN_HAND )
194189
@@ -201,15 +196,15 @@ object InteractManager : Manager<InteractRequest>(
201196 }
202197 val interactDelay = ctx.interactConfig.interactDelay
203198 interactCooldown = if (interactDelay == 0 ) 0 else interactDelay + 1
204- placementsThisTick ++
199+ interactionsThisTick ++
205200 iterator.remove()
206201 }
207202 return InteractResult .Finished
208203 }
209204
210205 private fun Automated.canInteractThisTick () =
211206 interactCooldown <= 0 &&
212- placementsThisTick < maxPlacementsThisTick &&
207+ interactionsThisTick < maxInteractionsThisTick &&
213208 PacketLimitHandler .canSendPackets(1 , PacketType .Interaction )
214209
215210 /* *
@@ -226,7 +221,7 @@ object InteractManager : Manager<InteractRequest>(
226221 .take(buildConfig.maxPendingActions - request.pendingInteractions.size.coerceAtLeast(0 ))
227222 .toMutableList()
228223
229- maxPlacementsThisTick = interactConfig.interactionsPerTick
224+ maxInteractionsThisTick = interactConfig.interactionsPerTick
230225 }
231226
232227 /* *
0 commit comments