Skip to content

Commit 7b613ea

Browse files
committed
Merge branch 'master' into 1.21.5
2 parents 8b848f2 + 7903f33 commit 7b613ea

File tree

11 files changed

+34
-24
lines changed

11 files changed

+34
-24
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ abstract class Configurable(
292292
description: String = "",
293293
unit: String = "",
294294
visibility: () -> Boolean = { true },
295-
) = DoubleSetting(name, defaultValue, range, step, description, visibility, unit).register()
295+
) = DoubleSetting(name, defaultValue, range, step, description, unit, visibility).register()
296296

297297
/**
298298
* Creates a [FloatSetting] with the provided parameters and adds it to the [settings].
@@ -317,7 +317,7 @@ abstract class Configurable(
317317
description: String = "",
318318
unit: String = "",
319319
visibility: () -> Boolean = { true },
320-
) = FloatSetting(name, defaultValue, range, step, description, visibility, unit).register()
320+
) = FloatSetting(name, defaultValue, range, step, description, unit, visibility).register()
321321

322322
/**
323323
* Creates an [IntegerSetting] with the provided parameters and adds it to the [settings].
@@ -342,7 +342,7 @@ abstract class Configurable(
342342
description: String = "",
343343
unit: String = "",
344344
visibility: () -> Boolean = { true },
345-
) = IntegerSetting(name, defaultValue, range, step, description, visibility, unit).register()
345+
) = IntegerSetting(name, defaultValue, range, step, description, unit, visibility).register()
346346

347347
/**
348348
* Creates a [LongSetting] with the provided parameters and adds it to the [settings].
@@ -367,7 +367,7 @@ abstract class Configurable(
367367
description: String = "",
368368
unit: String = "",
369369
visibility: () -> Boolean = { true },
370-
) = LongSetting(name, defaultValue, range, step, description, visibility, unit).register()
370+
) = LongSetting(name, defaultValue, range, step, description, unit, visibility).register()
371371

372372
/**
373373
* Creates a [KeyBindSetting] with the provided parameters and adds it to the [settings].

src/main/kotlin/com/lambda/config/groups/Targeting.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import com.lambda.interaction.request.rotation.Rotation.Companion.dist
2424
import com.lambda.interaction.request.rotation.Rotation.Companion.rotation
2525
import com.lambda.interaction.request.rotation.Rotation.Companion.rotationTo
2626
import com.lambda.threading.runSafe
27+
import com.lambda.util.extension.fullHealth
2728
import com.lambda.util.math.distSq
2829
import com.lambda.util.world.fastEntitySearch
2930
import net.minecraft.client.network.ClientPlayerEntity
@@ -201,7 +202,7 @@ abstract class Targeting(
201202
/**
202203
* Prioritizes entities based on their health.
203204
*/
204-
HEALTH({ it.health.toDouble() }),
205+
HEALTH({ it.fullHealth }),
205206

206207
/**
207208
* Prioritizes entities based on their angle relative to the player's field of view.

src/main/kotlin/com/lambda/config/settings/NumericSetting.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ abstract class NumericSetting<T>(
3131
open val range: ClosedRange<T>,
3232
open val step: T,
3333
description: String,
34-
visibility: () -> Boolean,
3534
val unit: String,
35+
visibility: () -> Boolean
3636
) : AbstractSetting<T>(
3737
value,
3838
TypeToken.get(value::class.java).type,

src/main/kotlin/com/lambda/config/settings/numeric/DoubleSetting.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,15 @@ class DoubleSetting(
3636
override val range: ClosedRange<Double>,
3737
override val step: Double,
3838
description: String,
39-
visibility: () -> Boolean,
4039
unit: String,
40+
visibility: () -> Boolean
4141
) : NumericSetting<Double>(
4242
defaultValue,
4343
range,
4444
step,
4545
description,
46-
visibility,
47-
unit
46+
unit,
47+
visibility
4848
) {
4949
override val layout: ImGuiBuilder.() -> Unit
5050
get() =

src/main/kotlin/com/lambda/config/settings/numeric/FloatSetting.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ class FloatSetting(
3535
override val range: ClosedRange<Float>,
3636
override val step: Float = 1f,
3737
description: String,
38-
visibility: () -> Boolean,
3938
unit: String,
39+
visibility: () -> Boolean
4040
) : NumericSetting<Float>(
4141
defaultValue,
4242
range,
4343
step,
4444
description,
45-
visibility,
46-
unit
45+
unit,
46+
visibility
4747
) {
4848
override val layout: ImGuiBuilder.() -> Unit
4949
get() =

src/main/kotlin/com/lambda/config/settings/numeric/IntegerSetting.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ class IntegerSetting(
3535
override val range: ClosedRange<Int>,
3636
override val step: Int = 1,
3737
description: String,
38-
visibility: () -> Boolean,
3938
unit: String,
39+
visibility: () -> Boolean
4040
) : NumericSetting<Int>(
4141
defaultValue,
4242
range,
4343
step,
4444
description,
45-
visibility,
46-
unit
45+
unit,
46+
visibility
4747
) {
4848
override val layout: ImGuiBuilder.() -> Unit
4949
get() =

src/main/kotlin/com/lambda/config/settings/numeric/LongSetting.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ class LongSetting(
3535
override val range: ClosedRange<Long>,
3636
override val step: Long = 1,
3737
description: String,
38-
visibility: () -> Boolean,
3938
unit: String,
39+
visibility: () -> Boolean
4040
) : NumericSetting<Long>(
4141
defaultValue,
4242
range,
4343
step,
4444
description,
45-
visibility,
46-
unit
45+
unit,
46+
visibility
4747
) {
4848
var intValue = value.toInt()
4949

src/main/kotlin/com/lambda/module/modules/client/Discord.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import com.lambda.threading.runConcurrent
3131
import com.lambda.util.Communication.warn
3232
import com.lambda.util.Nameable
3333
import com.lambda.util.extension.dimensionName
34+
import com.lambda.util.extension.fullHealth
3435
import com.lambda.util.extension.worldName
3536
import dev.cbyrne.kdiscordipc.KDiscordIPC
3637
import dev.cbyrne.kdiscordipc.core.packet.inbound.impl.AuthenticatePacket
@@ -116,7 +117,7 @@ object Discord : Module(
116117
VERSION({ Lambda.VERSION }),
117118
WORLD({ worldName }),
118119
USERNAME({ mc.session.username }),
119-
HEALTH({ "${player.health} HP" }),
120+
HEALTH({ "${player.fullHealth} HP" }),
120121
HUNGER({ "${player.hungerManager.foodLevel} Hunger" }),
121122
DIMENSION({ world.dimensionName }),
122123
FPS({ "${mc.currentFps} FPS" });

src/main/kotlin/com/lambda/module/modules/combat/AutoDisconnect.kt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import com.lambda.util.Formatting.string
3131
import com.lambda.util.combat.CombatUtils.hasDeadlyCrystal
3232
import com.lambda.util.combat.DamageUtils.isFallDeadly
3333
import com.lambda.util.extension.tickDelta
34+
import com.lambda.util.extension.fullHealth
3435
import com.lambda.util.player.SlotUtils.combined
3536
import com.lambda.util.text.buildText
3637
import com.lambda.util.text.color
@@ -161,7 +162,7 @@ object AutoDisconnect : Module(
161162
literal(" on ")
162163
highlighted(Communication.currentTime())
163164
literal(" with ")
164-
highlighted(player.health.string)
165+
highlighted(player.fullHealth.string)
165166
literal(" health.")
166167
if (player.isSubmergedInWater) {
167168
literal("\n")
@@ -191,10 +192,10 @@ object AutoDisconnect : Module(
191192

192193
enum class Reason(val check: () -> Boolean, val generateReason: SafeContext.() -> Text?) {
193194
HEALTH({ health }, {
194-
if (player.health < minimumHealth) {
195+
if (player.fullHealth < minimumHealth) {
195196
buildText {
196197
literal("Health ")
197-
highlighted(player.health.string)
198+
highlighted(player.fullHealth.string)
198199
literal(" below minimum of ")
199200
highlighted("$minimumHealth")
200201
literal("!")

src/main/kotlin/com/lambda/module/modules/network/PacketLimiter.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ object PacketLimiter : Module(
3939
private var packetQueue = LimitedDecayQueue<PacketEvent.Send.Pre>(99, 1000)
4040
private val limit by setting("Limit", 99, 1..100, 1, "The maximum amount of packets to send per given time interval", unit = " packets")
4141
.onValueChange { _, to -> packetQueue.setSizeLimit(to) }
42-
43-
private val interval by setting("Duration", 1000L, 1L..1000L, 50L, "The interval / duration in milliseconds to limit packets for", unit = " ms")
42+
43+
private val interval by setting("Duration", 4000L, 1L..10000L, 50L, "The interval / duration in milliseconds to limit packets for", unit = " ms")
4444
.onValueChange { _, to -> packetQueue.setDecayTime(to) }
4545

4646
private val defaultIgnorePackets = setOf(

0 commit comments

Comments
 (0)