Skip to content

Commit

Permalink
feat(FakeLag): flush options (#4785)
Browse files Browse the repository at this point in the history
  • Loading branch information
1zun4 authored Dec 2, 2024
1 parent 5296565 commit e829bf1
Showing 1 changed file with 24 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ object ModuleFakeLag : ClientModule("FakeLag", Category.COMBAT) {
private val delay by intRange("Delay", 300..600, 0..1000, "ms")
private val mode by enumChoice("Mode", Mode.DYNAMIC).apply { tagBy(this) }

private val flushOnEntityInteract by boolean("FlushOnEntityInteract", true)
private val flushOnBlockInteract by boolean("FlushOnBlockInteract", true)
private val flushOnAction by boolean("FlushOnAction", true)

private enum class Mode(override val choiceName: String) : NamedChoice {
CONSTANT("Constant"),
DYNAMIC("Dynamic")
Expand Down Expand Up @@ -107,15 +111,30 @@ object ModuleFakeLag : ClientModule("FakeLag", Category.COMBAT) {
when (val packet = event.packet) {

is PlayerPositionLookS2CPacket,
is PlayerInteractBlockC2SPacket,
is PlayerActionC2SPacket,
is UpdateSignC2SPacket,
is PlayerInteractEntityC2SPacket,
is HandSwingC2SPacket,
is ResourcePackStatusC2SPacket -> {
return@handler
}

is PlayerInteractEntityC2SPacket,
is HandSwingC2SPacket -> {
if (flushOnEntityInteract) {
return@handler
}
}

is PlayerInteractBlockC2SPacket,
is UpdateSignC2SPacket -> {
if (flushOnBlockInteract) {
return@handler
}
}

is PlayerActionC2SPacket -> {
if (flushOnAction) {
return@handler
}
}

// Flush on knockback
is EntityVelocityUpdateS2CPacket -> {
if (packet.entityId == player.id && (packet.velocityX != 0 || packet.velocityY != 0 || packet.velocityZ != 0)) {
Expand Down

0 comments on commit e829bf1

Please sign in to comment.