Skip to content

Commit 210fa39

Browse files
author
Doogie13
committed
added ground mode for some servers idk
1 parent 54ce5db commit 210fa39

3 files changed

Lines changed: 29 additions & 11 deletions

File tree

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
org.gradle.jvmargs=-Xmx3G
22
modGroup=com.lambda
3-
modVersion=1.1
3+
modVersion=1.2
44
kotlin_version=1.5.20
55
kotlinx_coroutines_version=1.5.0-RC
66
org.gradle.parallel=true

src/main/kotlin/LongJump.kt

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,20 @@ internal object LongJump : PluginModule(
1010
description = "Jump Longer",
1111
pluginMain = LongJumpController
1212
) {
13-
private val farSpeed by setting("Speed", 1.0f, 0.0f..10.0f, 0.1f, description = "Long Jump Factor")
13+
private val mode by setting("Mode", enumMode.Peak)
14+
private val farSpeed by setting("Peak Speed", 1.0f, 0.0f..10.0f, 0.1f, { mode.equals(enumMode.Peak) }, description = "Speed When Falling")
15+
private val groundSpeed by setting("Ground Speed", 2.0f, 0.0f..10.0f, 0.1f, { mode.equals(enumMode.Ground) }, description = "Speed When Jumping")
1416
private val disableOnRubberband by setting("Rubberband disable", false)
1517

1618
var has = false;
1719

20+
private enum class enumMode {
21+
22+
Peak,
23+
Ground
24+
25+
}
26+
1827
init {
1928

2029
onEnable {
@@ -23,20 +32,29 @@ internal object LongJump : PluginModule(
2332

2433
safeListener<PlayerTravelEvent> {
2534

26-
if (mc.player.motionY <= 0 && !has) {
27-
28-
has = true
35+
if (LagNotifier.paused && disableOnRubberband) {
2936

30-
mc.player.jumpMovementFactor = farSpeed
37+
disable()
3138

3239
}
3340

34-
if (mc.player.onGround)
35-
has = false
41+
if (mode.equals(enumMode.Peak)) {
42+
if (mc.player.motionY <= 0 && !has) {
3643

37-
if (LagNotifier.paused && disableOnRubberband) {
44+
has = true
3845

39-
disable()
46+
mc.player.jumpMovementFactor = farSpeed
47+
48+
}
49+
50+
if (mc.player.onGround)
51+
has = false
52+
53+
} else if (mc.player.onGround) {
54+
55+
mc.player.jump();
56+
mc.player.motionX *= groundSpeed
57+
mc.player.motionY *= groundSpeed
4058

4159
}
4260

src/main/resources/plugin_info.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "LongJump",
3-
"version": "1.1",
3+
"version": "1.2",
44
"authors": [
55
"Doogie13"
66
],

0 commit comments

Comments
 (0)