Skip to content

Commit

Permalink
fix(legacy): StackOverFlow from NoRotationDisabler option from Disabl…
Browse files Browse the repository at this point in the history
…er. (CCBlueX#5569)
  • Loading branch information
mems01 authored Feb 9, 2025
1 parent dd8e465 commit 4a126b0
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,38 +121,38 @@ object Disabler : Module("Disabler", Category.EXPLOIT) {
when (packet) {
is C00PacketKeepAlive -> if (cancelC00) {
event.cancelEvent()
debugMessage("Cancel C00-KeepAlive")
debugMessage("Cancelled C00-KeepAlive")
}

is C0FPacketConfirmTransaction -> if (cancelC0F) {
event.cancelEvent()
debugMessage("Cancel C0F-Transaction")
debugMessage("Cancelled C0F-Transaction")
}

is C0APacketAnimation -> if (cancelC0A) {
event.cancelEvent()
debugMessage("Cancel C0A-Swing")
debugMessage("Cancelled C0A-Swing")
}

is C0BPacketEntityAction -> if (cancelC0B) {
event.cancelEvent()
debugMessage("Cancel C0B-Action")
debugMessage("Cancelled C0B-Action")
}

is C07PacketPlayerDigging -> if (cancelC07) {
event.cancelEvent()
debugMessage("Cancel C07-Digging")
debugMessage("Cancelled C07-Digging")
}

is C13PacketPlayerAbilities -> if (cancelC13) {
event.cancelEvent()
debugMessage("Cancel C13-Abilities")
debugMessage("Cancelled C13-Abilities")
}

is C03PacketPlayer -> if (cancelC03 && !(packet is C04PacketPlayerPosition || packet is C05PacketPlayerLook || packet is C06PacketPlayerPosLook)) {
if (c03NoMove && player.isMoving) return@handler
event.cancelEvent()
debugMessage("Cancel C03-Flying")
debugMessage("Cancelled C03-Flying")
}
}
}
Expand All @@ -168,10 +168,10 @@ object Disabler : Module("Disabler", Category.EXPLOIT) {
packet.y,
packet.z,
packet.onGround
)
), false
)
} else {
sendPacket(C03PacketPlayer(packet.onGround))
sendPacket(C03PacketPlayer(packet.onGround), false)
}
event.cancelEvent()
}
Expand Down Expand Up @@ -200,7 +200,7 @@ object Disabler : Module("Disabler", Category.EXPLOIT) {
0.0f,
0.0f,
packet.onGround
)
), false
)
} else {
sendPacket(
Expand All @@ -211,7 +211,7 @@ object Disabler : Module("Disabler", Category.EXPLOIT) {
0.0f,
0.0f,
packet.onGround
)
), false
)
}
event.cancelEvent()
Expand Down Expand Up @@ -283,9 +283,9 @@ object Disabler : Module("Disabler", Category.EXPLOIT) {
packet.placedBlockOffsetX,
packet.placedBlockOffsetY,
packet.placedBlockOffsetZ
)
), false
)
debugMessage("§cModify §aPlace §cPacket§7.")
debugMessage("§cModified §aPlace §cPacket§7.")
}
}

Expand All @@ -294,7 +294,7 @@ object Disabler : Module("Disabler", Category.EXPLOIT) {
if (packet is S08PacketPlayerPosLook) {
if (player.capabilities.isFlying) {
shouldDelay = true
debugMessage("§cStart Canceling IntaveFly")
debugMessage("§cStarted Canceling IntaveFly")
}
}

Expand Down Expand Up @@ -330,7 +330,7 @@ object Disabler : Module("Disabler", Category.EXPLOIT) {
if (transaction) 1 else -1,
if (transaction) -1 else 1,
transaction
), triggerEvent = false
), false
)
transaction = !transaction
}
Expand Down Expand Up @@ -399,23 +399,23 @@ object Disabler : Module("Disabler", Category.EXPLOIT) {
-48.0,
player.posZ,
true
)
), false
)
sendPacket(
C04PacketPlayerPosition(
player.posX,
player.posY,
player.posZ,
false
)
), false
)
sendPacket(
C04PacketPlayerPosition(
player.posX,
player.posY,
player.posZ,
player.onGround
)
), false
)
cancelNext = 2
event.cancelEvent()
Expand All @@ -425,7 +425,7 @@ object Disabler : Module("Disabler", Category.EXPLOIT) {
} else if (verusExpVoidTP && packet is S08PacketPlayerPosLook && cancelNext > 0) {
cancelNext--
event.cancelEvent()
debugMessage("VerusExp canceled server position look")
debugMessage("VerusExp cancelled server position look")
}
}
// the disabler is really horrible yet simple,
Expand All @@ -436,7 +436,7 @@ object Disabler : Module("Disabler", Category.EXPLOIT) {
if (packet is S08PacketPlayerPosLook && player.ticksExisted >= 100) {
event.cancelEvent()
// accept the new position & rotation
debugMessage("Setbacked, cancelled event & silently accepting new position")
debugMessage("Set back, cancelled event & silently accepting new position")
sendPacket(
C06PacketPlayerPosLook(
packet.x,
Expand All @@ -445,7 +445,7 @@ object Disabler : Module("Disabler", Category.EXPLOIT) {
packet.yaw,
packet.pitch,
player.onGround
)
), false
)
sendPacket(
C06PacketPlayerPosLook(
Expand All @@ -455,7 +455,7 @@ object Disabler : Module("Disabler", Category.EXPLOIT) {
player.rotationYaw,
player.rotationPitch,
player.onGround
)
), false
)
}
}
Expand Down Expand Up @@ -546,9 +546,9 @@ object Disabler : Module("Disabler", Category.EXPLOIT) {
repeat(betaVerusRepeatTimes) {
sendPacket(packet, false)
}
debugMessage("Send Packet Buff")
debugMessage("Packet Buffer Dump")
} else {
debugMessage("Empty Packet Buff")
debugMessage("Empty Packet Buffer")
}
}
}
Expand Down
8 changes: 2 additions & 6 deletions src/main/java/net/ccbluex/liquidbounce/ui/client/hud/HUD.kt
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,7 @@ object HUD : MinecraftInstance {
}

/** Remove [element] from HUD */
fun removeElement(hudDesigner: GuiHudDesigner, element: Element): HUD {
if (hudDesigner.elementEditableText?.element == element) {
hudDesigner.elementEditableText = null
}

fun removeElement(element: Element): HUD {
element.destroyElement()
elements.remove(element)
return this
Expand All @@ -197,7 +193,7 @@ object HUD : MinecraftInstance {

/** Add [notification] */
fun addNotification(notification: Notification) =
elements.any { it is Notifications } && notifications.add(notification)
elements.any { it is Notifications }.also { mc.addScheduledTask { notifications.add(notification) } }

/** Remove [notification] */
fun removeNotification(notification: Notification) = notifications.remove(notification)
Expand Down

0 comments on commit 4a126b0

Please sign in to comment.