Skip to content

Commit

Permalink
fix(AutoBlock): blink blocking (#5481)
Browse files Browse the repository at this point in the history
  • Loading branch information
1zun4 authored Jan 28, 2025
1 parent c99a2bc commit c2bbaf0
Showing 1 changed file with 15 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,15 +177,25 @@ object KillAuraAutoBlock : ToggleableConfigurable(ModuleKillAura, "AutoBlocking"
return@handler
}

val packet = event.packet
if (!blockVisual || flushTicks >= blink || packet is PlayerInteractItemC2SPacket
|| packet is UpdateSelectedSlotC2SPacket) {
fun flush(reason: String) {
ModuleDebug.debugParameter(this, "Flush", flushTicks)
ModuleDebug.debugParameter(this, "Flush Reason", reason)
flushTicks = 0
return@handler
}

event.action = PacketQueueManager.Action.QUEUE
when {
// Not blocking
!blockVisual -> flush("N")

// Start blocking
blockingStateEnforced || event.packet is PlayerInteractItemC2SPacket -> flush("B")

// Timeout reached
flushTicks >= blink -> flush("T")

// Start to queue
else -> event.action = PacketQueueManager.Action.QUEUE
}
}

fun stopBlocking(pauses: Boolean = false): Boolean {
Expand Down

0 comments on commit c2bbaf0

Please sign in to comment.