Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update DisablerVulcanScaffold.kt #4181

Merged
merged 11 commits into from
Oct 26, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -23,34 +23,54 @@ import net.ccbluex.liquidbounce.event.events.PlayerTickEvent
import net.ccbluex.liquidbounce.event.handler
import net.ccbluex.liquidbounce.features.module.modules.exploit.disabler.ModuleDisabler
import net.minecraft.network.packet.c2s.play.ClientCommandC2SPacket
import net.ccbluex.liquidbounce.features.module.modules.world.scaffold.ModuleScaffold.isTowering
import net.ccbluex.liquidbounce.features.module.modules.world.scaffold.techniques.normal.ScaffoldTellyFeature.isTellyBridging
import kotlin.random.Random

/**
/*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/*
/**

* Tested on eu.loyisa.cn, anticheat-test.com
* Author: Nullable
* Author: TrimoneWasTaken
*
* Sending start sprint and stop sprint disables vulcan direction sprint checks,
* since vulcan thinks you are just spamming sprint.
*
* Most vulcan scaffold checks (including limit) check if you have sneaked in
* the last 15 ticks. By using packets to sneak and unsneak, you can
* the last 15 ticks. By using packets to unsneak, you can exploit this check and
* disable limit checks.
*/

internal object DisablerVulcanScaffold : ToggleableConfigurable(ModuleDisabler, "VulcanScaffold", false) {

@Suppress("ComplexCondition")
val tickHandler = handler<PlayerTickEvent> {
if (player.isInFluid || player.isTouchingWater || player.isDead || player.isHoldingOntoLadder
|| player.abilities.flying) {

if (player.isInFluid || player.isTouchingWater || player.isDead || player.isHoldingOntoLadder|| player.abilities.flying) {
// If the player meets one of theese requirements we return to the handler or else it will flag
1zun4 marked this conversation as resolved.
Show resolved Hide resolved
return@handler
}

network.sendPacket(ClientCommandC2SPacket(player, ClientCommandC2SPacket.Mode.START_SPRINTING))
network.sendPacket(ClientCommandC2SPacket(player, ClientCommandC2SPacket.Mode.STOP_SPRINTING))
if (player.age % 10 == 0) {
network.sendPacket(ClientCommandC2SPacket(player, ClientCommandC2SPacket.Mode.PRESS_SHIFT_KEY))
network.sendPacket(ClientCommandC2SPacket(player, ClientCommandC2SPacket.Mode.RELEASE_SHIFT_KEY))
// Fix for the disabler not triggering while telly bridging
if (isTellyBridging && player.age % 9 == 0 && Random.nextFloat() <= 0.7f) {
network.sendPacket(ClientCommandC2SPacket(player,ClientCommandC2SPacket.Mode.RELEASE_SHIFT_KEY))
}
}

}
if (player.isOnGround && isTowering && Random.nextFloat() <= 0.2f) {
/*
* We use probability to send unsneak when the player is on ground and is towering to fix the
* flag of scaffold-packets check and scaffold K check, this implementation
* works with low hop towers like karhu, or any tower that sometimes hit the ground.
*/

network.sendPacket(ClientCommandC2SPacket(player,ClientCommandC2SPacket.Mode.RELEASE_SHIFT_KEY))
}

network.sendPacket(ClientCommandC2SPacket(player,ClientCommandC2SPacket.Mode.START_SPRINTING))
network.sendPacket(ClientCommandC2SPacket(player,ClientCommandC2SPacket.Mode.STOP_SPRINTING))

if (player.age % 9 == 0) {
if (player.isOnGround && !isTellyBridging && !isTowering) {
network.sendPacket(ClientCommandC2SPacket(player, ClientCommandC2SPacket.Mode.RELEASE_SHIFT_KEY))
}
}
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (player.age % 9 == 0) {
if (player.isOnGround && !isTellyBridging && !isTowering) {
network.sendPacket(ClientCommandC2SPacket(player, ClientCommandC2SPacket.Mode.RELEASE_SHIFT_KEY))
}
}
}
}
if (player.age % 9 == 0 && player.isOnGround && !isTellyBridging && !isTowering) {
network.sendPacket(ClientCommandC2SPacket(player, ClientCommandC2SPacket.Mode.RELEASE_SHIFT_KEY))
}
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ object ScaffoldTellyFeature : ToggleableConfigurable(ScaffoldNormalTechnique, "T
val doNotAim: Boolean
get() = offGroundTicks < straightTicks && ticksUntilJump >= jumpTicks

// New val to determine if the player is telly bridging
val isTellyBridging: Boolean
get() = ticksUntilJump >= jumpTicks && player.moving

private var offGroundTicks = 0
private var ticksUntilJump = 0

Expand Down Expand Up @@ -71,7 +75,7 @@ object ScaffoldTellyFeature : ToggleableConfigurable(ScaffoldNormalTechnique, "T
}
}

@Suppress
@Suppress("unused")
private val afterJumpHandler = handler<PlayerAfterJumpEvent> {
ticksUntilJump = 0
jumpTicks = jumpTicksOpt.random()
Expand Down