Skip to content

Commit 43da82c

Browse files
committed
feat(speed): add custom behavior and mode onPreMotion real na basem, old BlocksMC, legacy LatestVerusHop, VerusDamage, VerusSpeeds and vulcan
1 parent c2937b8 commit 43da82c

10 files changed

Lines changed: 537 additions & 26 deletions

File tree

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

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import net.ccbluex.liquidbounce.features.module.modules.movement.speedmodes.veru
3030
import net.ccbluex.liquidbounce.features.module.modules.movement.speedmodes.vulcan.VulcanGround288
3131
import net.ccbluex.liquidbounce.features.module.modules.movement.speedmodes.vulcan.VulcanHop
3232
import net.ccbluex.liquidbounce.features.module.modules.movement.speedmodes.vulcan.VulcanLowHop
33+
import net.ccbluex.liquidbounce.features.module.modules.movement.speedmodes.vulcan.VulcanSpeeds
3334
import net.ccbluex.liquidbounce.utils.extensions.isMoving
3435

3536
object Speed : Module("Speed", Category.MOVEMENT, Category.SubCategory.MOVEMENT_MAIN) {
@@ -64,12 +65,14 @@ object Speed : Module("Speed", Category.MOVEMENT, Category.SubCategory.MOVEMENT_
6465
VerusFHop,
6566
VerusLowHop,
6667
VerusLowHopNew,
68+
LatestVerusHop,
6769
VerusSpeeds,
6870

6971
// Vulcan
7072
VulcanHop,
7173
VulcanLowHop,
7274
VulcanGround288,
75+
VulcanSpeeds,
7376

7477
// Matrix
7578
OldMatrixHop,
@@ -127,12 +130,74 @@ object Speed : Module("Speed", Category.MOVEMENT, Category.SubCategory.MOVEMENT_
127130
val mode = choices("Mode", modesList.map { it.modeName }.toTypedArray(), "NCPBHop")
128131

129132
// Custom Speed
133+
val customBehavior by choices("CustomBehavior", arrayOf("Current", "Legacy"), "Current") { mode.get() == "Custom" }
130134
val customY by float("CustomY", 0.42f, 0f..4f) { mode.get() == "Custom" }
131135
val customGroundStrafe by float("CustomGroundStrafe", 1.6f, 0f..2f) { mode.get() == "Custom" }
132136
val customAirStrafe by float("CustomAirStrafe", 0f, 0f..2f) { mode.get() == "Custom" }
133137
val customGroundTimer by float("CustomGroundTimer", 1f, 0.1f..2f) { mode.get() == "Custom" }
134138
val customAirTimerTick by int("CustomAirTimerTick", 5, 1..20) { mode.get() == "Custom" }
135139
val customAirTimer by float("CustomAirTimer", 1f, 0.1f..2f) { mode.get() == "Custom" }
140+
val legacyCustomSpeed by float("CustomSpeed", 1.6f, 0f..2f) { mode.get() == "Custom" && customBehavior == "Legacy" }
141+
val legacyCustomDoLaunchSpeed by boolean("CustomDoLaunchSpeed", true) { mode.get() == "Custom" && customBehavior == "Legacy" }
142+
val legacyCustomLaunchSpeed by float("CustomLaunchSpeed", 1.6f, 0.2f..2f) {
143+
mode.get() == "Custom" && customBehavior == "Legacy" && legacyCustomDoLaunchSpeed
144+
}
145+
val legacyCustomLaunchMoveBeforeJump by boolean("CustomLaunchMoveBeforeJump", false) {
146+
mode.get() == "Custom" && customBehavior == "Legacy"
147+
}
148+
val legacyCustomDoMinimumSpeed by boolean("CustomDoMinimumSpeed", true) {
149+
mode.get() == "Custom" && customBehavior == "Legacy"
150+
}
151+
val legacyCustomMinimumSpeed by float("CustomMinimumSpeed", 0.25f, 0.1f..2f) {
152+
mode.get() == "Custom" && customBehavior == "Legacy" && legacyCustomDoMinimumSpeed
153+
}
154+
val legacyCustomAddYMotion by float("CustomAddYMotion", 0f, 0f..2f) {
155+
mode.get() == "Custom" && customBehavior == "Legacy"
156+
}
157+
val legacyCustomDoModifyJumpY by boolean("CustomDoModifyJumpY", true) {
158+
mode.get() == "Custom" && customBehavior == "Legacy"
159+
}
160+
val legacyCustomUpTimer by float("CustomUpTimer", 1f, 0.1f..2f) {
161+
mode.get() == "Custom" && customBehavior == "Legacy"
162+
}
163+
val legacyCustomJumpTimer by float("CustomJumpTimer", 1.25f, 0.1f..2f) {
164+
mode.get() == "Custom" && customBehavior == "Legacy"
165+
}
166+
val legacyCustomDownTimer by float("CustomDownTimer", 1f, 0.1f..2f) {
167+
mode.get() == "Custom" && customBehavior == "Legacy"
168+
}
169+
val legacyCustomUpAirSpeed by float("CustomUpAirSpeed", 2.03f, 0.5f..3.5f) {
170+
mode.get() == "Custom" && customBehavior == "Legacy"
171+
}
172+
val legacyCustomDownAirSpeed by float("CustomDownAirSpeed", 2.01f, 0.5f..3.5f) {
173+
mode.get() == "Custom" && customBehavior == "Legacy"
174+
}
175+
val legacyCustomStrafe by choices(
176+
"CustomStrafe",
177+
arrayOf("Strafe", "Boost", "AirSpeed", "Plus", "PlusOnlyUp", "PlusOnlyDown", "Non-Strafe"),
178+
"Boost"
179+
) { mode.get() == "Custom" && customBehavior == "Legacy" }
180+
val legacyCustomPlusMode by choices("PlusBoostMode", arrayOf("Add", "Multiply"), "Add") {
181+
mode.get() == "Custom" && customBehavior == "Legacy" &&
182+
legacyCustomStrafe in arrayOf("Plus", "PlusOnlyUp", "PlusOnlyDown")
183+
}
184+
val legacyCustomPlusMultiplyAmount by float("PlusMultiplyAmount", 1.1f, 1f..2f) {
185+
mode.get() == "Custom" && customBehavior == "Legacy" &&
186+
legacyCustomPlusMode == "Multiply" &&
187+
legacyCustomStrafe in arrayOf("Plus", "PlusOnlyUp", "PlusOnlyDown")
188+
}
189+
val legacyCustomGroundStay by int("CustomGroundStay", 0, 0..10) { mode.get() == "Custom" && customBehavior == "Legacy" }
190+
val legacyCustomGroundResetXZ by boolean("CustomGroundResetXZ", false) { mode.get() == "Custom" && customBehavior == "Legacy" }
191+
val legacyCustomDoJump by boolean("CustomDoJump", true) { mode.get() == "Custom" && customBehavior == "Legacy" }
192+
val legacyCustomPressSpaceKeyOnGround by boolean("CustomPressSpaceKeyOnGround", true) {
193+
mode.get() == "Custom" && customBehavior == "Legacy"
194+
}
195+
val legacyCustomPressSpaceKeyInAir by boolean("CustomPressSpaceKeyInAir", false) {
196+
mode.get() == "Custom" && customBehavior == "Legacy"
197+
}
198+
val legacyCustomUsePreMotion by boolean("CustomUsePreMotion", true) {
199+
mode.get() == "Custom" && customBehavior == "Legacy"
200+
}
136201

137202
// Extra options
138203
val resetXZ by boolean("ResetXZ", false) { mode.get() == "Custom" }
@@ -166,6 +231,36 @@ object Speed : Module("Speed", Category.MOVEMENT, Category.SubCategory.MOVEMENT_
166231
val verusSpeed by choices("Verus-Mode", arrayOf("OldHop", "Float", "Ground", "YPort", "YPort2"), "OldHop") { mode.get() == "VerusSpeeds" }
167232
val verusYPortspeedValue by float("YPort-Speed", 0.61f, 0.1f.. 1f) { mode.get() == "VerusSpeeds" }
168233
val verusYPort2speedValue by float("YPort2-Speed", 0.61f, 0.1f.. 1f) { mode.get() == "VerusSpeeds" }
234+
val latestVerusHopCustomSpeed by boolean("LatestVerusHop-CustomSpeed", false) { mode.get() == "LatestVerusHop" }
235+
val latestVerusHopJumpMovementFactorWithPotion by float("LatestVerusHop-JumpMovementFactorWithPotion", 0.02f, 0.01f..0.04f) {
236+
mode.get() == "LatestVerusHop" && latestVerusHopCustomSpeed
237+
}
238+
val latestVerusHopJumpMovementFactorWithoutPotion by float("LatestVerusHop-JumpMovementFactorWithoutPotion", 0.02f, 0.01f..0.04f) {
239+
mode.get() == "LatestVerusHop" && latestVerusHopCustomSpeed
240+
}
241+
val latestVerusHopFrictionWithPotion by float("LatestVerusHop-FrictionWithPotion", 0.48f, 0.1f..2f) {
242+
mode.get() == "LatestVerusHop" && latestVerusHopCustomSpeed
243+
}
244+
val latestVerusHopFrictionWithoutPotion by float("LatestVerusHop-FrictionWithoutPotion", 0.48f, 0.1f..2f) {
245+
mode.get() == "LatestVerusHop" && latestVerusHopCustomSpeed
246+
}
247+
val latestVerusHopSpeedWithPotion by float("LatestVerusHop-SpeedWithPotion", 2.8f, 1f..4f) {
248+
mode.get() == "LatestVerusHop" && latestVerusHopCustomSpeed
249+
}
250+
val latestVerusHopSpeedWithoutPotion by float("LatestVerusHop-SpeedWithoutPotion", 2.0f, 1f..4f) {
251+
mode.get() == "LatestVerusHop" && latestVerusHopCustomSpeed
252+
}
253+
val latestVerusHopDamageBoost by boolean("LatestVerusHop-DamageBoost", false) { mode.get() == "LatestVerusHop" }
254+
val latestVerusHopBoostSpeed by float("LatestVerusHop-BoostSpeed", 1f, 0.1f..9f) {
255+
mode.get() == "LatestVerusHop" && latestVerusHopDamageBoost
256+
}
257+
258+
// Vulcan legacy speed pack
259+
val vulcanMode by choices("Vulcan-Mode", arrayOf("LowHop", "Hop", "OldGround", "YPort", "YPort2", "LowHop2"), "LowHop") {
260+
mode.get() == "Vulcan"
261+
}
262+
val vulcanBoostDelay by int("Boost-Delay", 8, 2..15) { mode.get() == "Vulcan" && vulcanMode == "OldGround" }
263+
val vulcanGroundBoost by boolean("Ground-Boost", true) { mode.get() == "Vulcan" && vulcanMode == "OldGround" }
169264

170265
// UNCPHopNew Speed
171266
private val pullDown by boolean("PullDown", true) { mode.get() == "UNCPHopNew" }
@@ -215,6 +310,7 @@ object Speed : Module("Speed", Category.MOVEMENT, Category.SubCategory.MOVEMENT_
215310
thePlayer.isSprinting = true
216311

217312
modeModule.onMotion()
313+
modeModule.onPreMotion()
218314
}
219315

220316
val onMove = handler<MoveEvent> { event ->

src/main/java/net/ccbluex/liquidbounce/features/module/modules/movement/longjumpmodes/other/VerusDamage.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
package net.ccbluex.liquidbounce.features.module.modules.movement.longjumpmodes.other
77

88
import net.ccbluex.liquidbounce.features.module.modules.movement.LongJump
9-
import net.ccbluex.liquidbounce.features.module.modules.movement.LongJump.autoDisable
9+
import net.ccbluex.liquidbounce.features.module.modules.movement.LongJump.autoDisableValue
1010
import net.ccbluex.liquidbounce.features.module.modules.movement.longjumpmodes.LongJumpMode
1111
import net.ccbluex.liquidbounce.utils.client.PacketUtils.sendPacket
1212
import net.ccbluex.liquidbounce.utils.client.chat
@@ -72,12 +72,12 @@ object VerusDamage : LongJumpMode("VerusDamage") {
7272
player.motionY += 0.015f
7373

7474
// player onGround checks will not work due to sendPacket ground, so for temporary. I'll be using player motionY.
75-
if (autoDisable && player.motionY <= -0.4330104027478734) {
75+
if (autoDisableValue && player.motionY <= -0.4330104027478734) {
7676
player.stopXZ()
7777
LongJump.state = false
7878
}
79-
} else if (autoDisable) {
79+
} else if (autoDisableValue) {
8080
LongJump.state = false
8181
}
8282
}
83-
}
83+
}

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import net.ccbluex.liquidbounce.event.PacketEvent
1111
import net.ccbluex.liquidbounce.utils.client.MinecraftInstance
1212

1313
open class SpeedMode(val modeName: String) : MinecraftInstance {
14+
open fun onPreMotion() {}
1415
open fun onMotion() {}
1516
open fun onUpdate() {}
1617
open fun onMove(event: MoveEvent) {}
@@ -21,4 +22,4 @@ open class SpeedMode(val modeName: String) : MinecraftInstance {
2122
open fun onEnable() {}
2223
open fun onDisable() {}
2324

24-
}
25+
}

src/main/java/net/ccbluex/liquidbounce/features/module/modules/movement/speedmodes/matrix/MatrixSpeeds.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ object MatrixSpeeds : SpeedMode("MatrixSpeeds") {
102102
}
103103
}
104104

105-
fun onPreMotion() {
105+
override fun onPreMotion() {
106106
when (matrixSpeed) {
107107
"Matrix6.6.1" -> {
108108
if (!matrixUsePreMotion) return
@@ -188,4 +188,4 @@ object MatrixSpeeds : SpeedMode("MatrixSpeeds") {
188188
}
189189
}
190190

191-
}
191+
}

src/main/java/net/ccbluex/liquidbounce/features/module/modules/movement/speedmodes/other/BlocksMCSpeed.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import net.ccbluex.liquidbounce.utils.movement.MovementUtils
1010
import net.ccbluex.liquidbounce.utils.extensions.isMoving
1111
import net.minecraft.potion.Potion
1212

13-
object BlocksMCSpeed : SpeedMode("Custom") {
13+
object BlocksMCSpeed : SpeedMode("BlocksMC") {
1414

1515
private var wasSlow = false
1616

0 commit comments

Comments
 (0)