Skip to content

Commit d7389ab

Browse files
committed
feat(longjump): restore legacy hooks and mode pack Motion, Packet, BlockBB, Step, AttemptJump, AttemptDisable, GlobalTimer, TimerOnlyAir, LegacyWarn, Boost, NCPLatest, OldNCPDamage, MatrixFlag, OldMatrixHurt and Vulcan
1 parent 43da82c commit d7389ab

9 files changed

Lines changed: 906 additions & 22 deletions

File tree

src/main/java/net/ccbluex/liquidbounce/features/module/modules/movement/LongJump.kt

Lines changed: 111 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,85 +5,167 @@
55
*/
66
package net.ccbluex.liquidbounce.features.module.modules.movement
77

8-
import net.ccbluex.liquidbounce.event.JumpEvent
9-
import net.ccbluex.liquidbounce.event.MoveEvent
10-
import net.ccbluex.liquidbounce.event.UpdateEvent
11-
import net.ccbluex.liquidbounce.event.handler
8+
import net.ccbluex.liquidbounce.event.*
129
import net.ccbluex.liquidbounce.features.module.Category
1310
import net.ccbluex.liquidbounce.features.module.Module
1411
import net.ccbluex.liquidbounce.features.module.modules.movement.longjumpmodes.aac.AACv1
1512
import net.ccbluex.liquidbounce.features.module.modules.movement.longjumpmodes.aac.AACv2
1613
import net.ccbluex.liquidbounce.features.module.modules.movement.longjumpmodes.aac.AACv3
14+
import net.ccbluex.liquidbounce.features.module.modules.movement.longjumpmodes.matrix.MatrixFlag
15+
import net.ccbluex.liquidbounce.features.module.modules.movement.longjumpmodes.matrix.OldMatrixHurt
16+
import net.ccbluex.liquidbounce.features.module.modules.movement.longjumpmodes.ncp.NCPLatest
1717
import net.ccbluex.liquidbounce.features.module.modules.movement.longjumpmodes.ncp.NCP
18+
import net.ccbluex.liquidbounce.features.module.modules.movement.longjumpmodes.ncp.OldNCPDamage
19+
import net.ccbluex.liquidbounce.features.module.modules.movement.longjumpmodes.other.Boost
1820
import net.ccbluex.liquidbounce.features.module.modules.movement.longjumpmodes.other.Buzz
1921
import net.ccbluex.liquidbounce.features.module.modules.movement.longjumpmodes.other.Hycraft
2022
import net.ccbluex.liquidbounce.features.module.modules.movement.longjumpmodes.other.Redesky
2123
import net.ccbluex.liquidbounce.features.module.modules.movement.longjumpmodes.other.VerusDamage
2224
import net.ccbluex.liquidbounce.features.module.modules.movement.longjumpmodes.other.VerusDamage.damaged
25+
import net.ccbluex.liquidbounce.features.module.modules.movement.longjumpmodes.vulcan.VulcanLongJumpMode
26+
import net.ccbluex.liquidbounce.utils.client.chat
2327
import net.ccbluex.liquidbounce.utils.extensions.isMoving
2428
import net.ccbluex.liquidbounce.utils.extensions.tryJump
2529

2630
object LongJump : Module("LongJump", Category.MOVEMENT, Category.SubCategory.MOVEMENT_MAIN) {
2731

2832
private val longJumpModes = arrayOf(
2933
// NCP
30-
NCP,
34+
NCP, NCPLatest, OldNCPDamage,
3135

3236
// AAC
3337
AACv1, AACv2, AACv3,
3438

39+
// Matrix
40+
MatrixFlag, OldMatrixHurt,
41+
3542
// Other
36-
Redesky, Hycraft, Buzz, VerusDamage
43+
Boost, Redesky, Hycraft, Buzz, VerusDamage,
44+
45+
// Vulcan
46+
VulcanLongJumpMode
3747
)
3848

3949
private val modes = longJumpModes.map { it.modeName }.toTypedArray()
4050

4151
val mode by choices("Mode", modes, "NCP")
4252
val ncpBoost by float("NCPBoost", 4.25f, 1f..10f) { mode == "NCP" }
53+
val autoJumpValue by boolean("AutoJump", true)
54+
val autoDisableValue by boolean("AutoDisable", true)
55+
val timerValue by float("GlobalTimer", 1f, 0.1f..2f)
56+
val onlyAirValue by boolean("TimerOnlyAir", true)
57+
val legacyWarningValue by boolean("LegacyWarn", true)
58+
59+
val boostSpeed by float("Boost-Speed", 0.48f, 0f..3f) { mode == "Boost" }
60+
val boostJumpBoost by float("Boost-JumpBoost", 1.5f, 1f..3f) { mode == "Boost" }
61+
val boostStrafeBoost by float("Boost-StrafeBoost", 1.5f, 1f..3f) { mode == "Boost" }
62+
63+
val ncpLatestBoost by float("NCPLatest-Boost", 10f, 1f..10f) { mode == "NCPLatest" }
64+
val ncpLatestBlink by boolean("NCPLatest-Blink", false) { mode == "NCPLatest" }
65+
val ncpLatestOldMMC by boolean("NCPLatest-OldMMC", false) { mode == "NCPLatest" }
66+
val ncpLatestWarn by boolean("NCPLatest-Warn", true) { mode == "NCPLatest" }
67+
68+
val oldNcpDamageMode by choices("OldNCPDamage-Mode", arrayOf("Normal", "OldHypixel"), "Normal") {
69+
mode == "OldNCPDamage"
70+
}
71+
val oldNcpDamageBoostSpeed by float("OldNCPDamage-BoostSpeed", 1.2f, 1f..2f) {
72+
mode == "OldNCPDamage" && oldNcpDamageMode == "OldHypixel"
73+
}
74+
val oldNcpDamageBoost by float("OldNCPDamage-Boost", 4.25f, 1f..10f) {
75+
mode == "OldNCPDamage" && oldNcpDamageMode == "Normal"
76+
}
77+
val oldNcpDamageInstant by boolean("OldNCPDamage-DamageInstant", false) { mode == "OldNCPDamage" }
4378

44-
private val autoJump by boolean("AutoJump", true)
79+
val oldMatrixHurtBoostSpeed by float("OldMatrixHurt-BoostSpeed", 0.416f, 0.1f..1f) { mode == "OldMatrixHurt" }
80+
val oldMatrixHurtTicks by int("OldMatrixHurt-Ticks", 10, 5..20) { mode == "OldMatrixHurt" }
4581

46-
val autoDisable by boolean("AutoDisable", true) { mode == "VerusDamage" }
82+
val vulcanRepeatTimes by int("Vulcan-RepeatTimes", 2, 1..6) { mode == "Vulcan" }
83+
val vulcanDistance by float("Vulcan-Distance", 7f, 2f..8f) { mode == "Vulcan" }
84+
val vulcanOnlyDamage by boolean("Vulcan-OnlyDamage", true) { mode == "Vulcan" }
85+
val vulcanSelfDamage by boolean("Vulcan-SelfDamage", true) { mode == "Vulcan" }
4786

4887
var jumped = false
4988
var canBoost = false
5089
var teleported = false
90+
var airTick = 0
91+
var noTimerModify = false
5192

5293
val onUpdate = handler<UpdateEvent> {
53-
if (jumped) {
54-
val mode = mode
94+
val player = mc.thePlayer ?: return@handler
5595

56-
if (mc.thePlayer.onGround || mc.thePlayer.capabilities.isFlying) {
57-
jumped = false
96+
if ((!onlyAirValue || !player.onGround) && !noTimerModify) {
97+
mc.timer.timerSpeed = timerValue
98+
}
5899

59-
if (mode == "NCP") {
60-
mc.thePlayer.motionX = 0.0
61-
mc.thePlayer.motionZ = 0.0
62-
}
63-
return@handler
100+
if (!player.onGround) {
101+
airTick++
102+
} else {
103+
if (airTick > 1 && autoDisableValue) {
104+
modeModule.onAttemptDisable()
105+
} else if (!autoDisableValue) {
106+
airTick = 0
64107
}
108+
}
109+
110+
if (jumped && (player.onGround || player.capabilities.isFlying)) {
111+
jumped = false
65112

66-
modeModule.onUpdate()
113+
if (mode == "NCP") {
114+
player.motionX = 0.0
115+
player.motionZ = 0.0
116+
}
67117
}
68-
if (autoJump && mc.thePlayer.onGround && mc.thePlayer.isMoving) {
69-
if (autoDisable && !damaged) {
118+
119+
modeModule.onUpdate()
120+
121+
if (autoJumpValue && player.onGround && player.isMoving && airTick < 2) {
122+
if (mode == "VerusDamage" && !damaged) {
70123
return@handler
71124
}
72125

73126
jumped = true
74-
mc.thePlayer.tryJump()
127+
modeModule.onAttemptJump()
75128
}
76129
}
77130

78131
val onMove = handler<MoveEvent> { event ->
79132
modeModule.onMove(event)
80133
}
81134

135+
val onMotion = handler<MotionEvent> { event ->
136+
modeModule.onMotion(event)
137+
}
138+
139+
val onPacket = handler<PacketEvent> { event ->
140+
modeModule.onPacket(event)
141+
}
142+
143+
val onBlockBB = handler<BlockBBEvent> { event ->
144+
modeModule.onBlockBB(event)
145+
}
146+
147+
val onStep = handler<StepEvent> { event ->
148+
modeModule.onStep(event)
149+
}
150+
82151
override fun onEnable() {
152+
airTick = 0
153+
noTimerModify = false
154+
jumped = false
155+
canBoost = false
156+
teleported = false
83157
modeModule.onEnable()
84158
}
85159

86160
override fun onDisable() {
161+
noTimerModify = false
162+
mc.thePlayer?.run {
163+
capabilities.isFlying = false
164+
capabilities.flySpeed = 0.05f
165+
noClip = false
166+
jumpMovementFactor = 0.02f
167+
}
168+
mc.timer.timerSpeed = 1f
87169
modeModule.onDisable()
88170
}
89171

@@ -100,6 +182,14 @@ object LongJump : Module("LongJump", Category.MOVEMENT, Category.SubCategory.MOV
100182
override val tag
101183
get() = mode
102184

185+
fun sendLegacyWarning(message: String = "This bypass is for an outdated anti cheat version!") {
186+
if (!legacyWarningValue) {
187+
return
188+
}
189+
190+
chat(message)
191+
}
192+
103193
private val modeModule
104194
get() = longJumpModes.find { it.modeName == mode }!!
105195
}

0 commit comments

Comments
 (0)