Skip to content

Commit 7204a88

Browse files
committed
Pausing, loops and sanity checks
1 parent de836f3 commit 7204a88

File tree

6 files changed

+159
-90
lines changed

6 files changed

+159
-90
lines changed

common/src/main/java/com/lambda/mixin/entity/ClientPlayerEntityMixin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ void processMovement(Input input, boolean slowDown, float slowDownFactor) {
6363

6464
@Redirect(method = "tickMovement", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayerEntity;isSprinting()Z"))
6565
boolean isSprinting(ClientPlayerEntity entity) {
66-
return !EventFlow.post(new MovementEvent.Sprint()).isCanceled();
66+
return EventFlow.post(new MovementEvent.Sprint(entity.isSprinting())).getSprint();
6767
}
6868

6969
@Inject(method = "sendMovementPackets", at = @At(value = "HEAD"), cancellable = true)

common/src/main/kotlin/com/lambda/config/Configurable.kt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,8 @@ abstract class Configurable(configuration: Configuration) : Jsonable, Nameable {
242242
range: ClosedRange<Byte>,
243243
step: Byte = 1,
244244
description: String = "",
245-
visibility: () -> Boolean = { true },
246245
unit: String = "",
246+
visibility: () -> Boolean = { true },
247247
) = ByteSetting(name, defaultValue, range, step, description, visibility, unit).also {
248248
settings.add(it)
249249
}
@@ -267,8 +267,8 @@ abstract class Configurable(configuration: Configuration) : Jsonable, Nameable {
267267
range: ClosedRange<Double>,
268268
step: Double = 1.0,
269269
description: String = "",
270-
visibility: () -> Boolean = { true },
271270
unit: String = "",
271+
visibility: () -> Boolean = { true },
272272
) = DoubleSetting(name, defaultValue, range, step, description, visibility, unit).also {
273273
settings.add(it)
274274
}
@@ -292,8 +292,8 @@ abstract class Configurable(configuration: Configuration) : Jsonable, Nameable {
292292
range: ClosedRange<Float>,
293293
step: Float = 1f,
294294
description: String = "",
295-
visibility: () -> Boolean = { true },
296295
unit: String = "",
296+
visibility: () -> Boolean = { true },
297297
) = FloatSetting(name, defaultValue, range, step, description, visibility, unit).also {
298298
settings.add(it)
299299
}
@@ -317,8 +317,8 @@ abstract class Configurable(configuration: Configuration) : Jsonable, Nameable {
317317
range: ClosedRange<Int>,
318318
step: Int = 1,
319319
description: String = "",
320-
visibility: () -> Boolean = { true },
321320
unit: String = "",
321+
visibility: () -> Boolean = { true },
322322
) = IntegerSetting(name, defaultValue, range, step, description, visibility, unit).also {
323323
settings.add(it)
324324
}
@@ -342,8 +342,8 @@ abstract class Configurable(configuration: Configuration) : Jsonable, Nameable {
342342
range: ClosedRange<Long>,
343343
step: Long = 1,
344344
description: String = "",
345-
visibility: () -> Boolean = { true },
346345
unit: String = "",
346+
visibility: () -> Boolean = { true },
347347
) = LongSetting(name, defaultValue, range, step, description, visibility, unit).also {
348348
settings.add(it)
349349
}
@@ -367,8 +367,8 @@ abstract class Configurable(configuration: Configuration) : Jsonable, Nameable {
367367
range: ClosedRange<Short>,
368368
step: Short = 1,
369369
description: String = "",
370-
visibility: () -> Boolean = { true },
371370
unit: String = "",
371+
visibility: () -> Boolean = { true },
372372
) = ShortSetting(name, defaultValue, range, step, description, visibility, unit).also {
373373
settings.add(it)
374374
}

common/src/main/kotlin/com/lambda/config/InteractionSettings.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class InteractionSettings(
77
c: Configurable,
88
vis: () -> Boolean = { true },
99
) : InteractionConfig {
10-
override val reach by c.setting("Reach", 5.0, 0.1..10.0, 0.1, "Players reach / range", vis)
11-
override val resolution by c.setting("Resolution", 10, 1..100, 1, "Raycast resolution", vis)
10+
override val reach by c.setting("Reach", 5.0, 0.1..10.0, 0.1, "Players reach / range", "", vis)
11+
override val resolution by c.setting("Resolution", 10, 1..100, 1, "Raycast resolution", "", vis)
1212
override val rayCastMask by c.setting("Raycast Mask", RayCastMask.BOTH, "What to raycast against", vis)
1313
}

common/src/main/kotlin/com/lambda/config/RotationSettings.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ class RotationSettings(
99
vis: () -> Boolean = { true },
1010
) : IRotationConfig {
1111
override var rotationMode by c.setting("Mode", RotationMode.SYNC, "SILENT - server-side rotation, SYNC - server-side rotation; client-side movement, LOCK - Lock camera", vis)
12-
override val keepTicks by c.setting("Keep Rotation", 3, 1..10, 1, "Ticks to keep rotation", vis)
13-
override val resetTicks by c.setting("Reset Rotation", 3, 1..10, 1, "Ticks before rotation is reset", vis)
12+
override val keepTicks by c.setting("Keep Rotation", 3, 1..10, 1, "Ticks to keep rotation", "", vis)
13+
override val resetTicks by c.setting("Reset Rotation", 3, 1..10, 1, "Ticks before rotation is reset", "", vis)
1414

15-
private val r1 by c.setting("Turn Speed 1", 70.0, 1.0..180.0, 0.1, "Rotation Speed 1", vis)
16-
private val r2 by c.setting("Turn Speed 2", 110.0, 1.0..180.0, 0.1, "Rotation Speed 2", vis)
15+
private val r1 by c.setting("Turn Speed 1", 70.0, 1.0..180.0, 0.1, "Rotation Speed 1", "", vis)
16+
private val r2 by c.setting("Turn Speed 2", 110.0, 1.0..180.0, 0.1, "Rotation Speed 2", "", vis)
1717

1818
override val turnSpeed get() = Random.nextDouble(r1, r2)
1919

common/src/main/kotlin/com/lambda/event/events/MovementEvent.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ abstract class MovementEvent : Event {
1515
var slowDownFactor: Float,
1616
) : MovementEvent()
1717

18-
class Sprint : MovementEvent(), ICancellable by Cancellable()
18+
class Sprint(var sprint: Boolean) : MovementEvent()
1919

2020
class ClipAtLedge(
2121
var clip: Boolean,

0 commit comments

Comments
 (0)