Skip to content

Commit 4d51870

Browse files
committed
applyPauseAfterBaritone setting in ElytraFly and update Nametags to only display your own players nametag when not in first person
1 parent 30c6deb commit 4d51870

3 files changed

Lines changed: 11 additions & 6 deletions

File tree

src/main/kotlin/com/lambda/module/modules/movement/ElytraFly.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ object ElytraFly : Module(
8686
private val jump by setting("Jump", true, "Automatically jumps") { mode == FlyMode.Bounce }
8787
private val flagPause by setting("Flag Pause", 5, 0..100, 1, "How long to pause if the server flags you for a movement check", "ticks") { mode == FlyMode.Bounce }
8888
private val passObstacles by setting("Pass Obstacles", true, "Automatically paths around obstacles using baritone") { mode == FlyMode.Bounce }
89+
private val applyPauseAfterBaritone by setting("Apply Pause After Baritone", false, "Ticks the flag pause after baritone has finished pathing") { mode == FlyMode.Bounce && passObstacles }
8990
private val acceptableOffsetRange by setting("Acceptable Offset Range", 2.0, 0.1..5.0, 0.01, "Acceptable offset from the original flight line to allow when starting to fly again after passing obstacles") { mode == FlyMode.Bounce && passObstacles }
9091
private val obstacleLookAhead by setting("Obstacle Look-Ahead", 15, 0..50, 1, "Looks ahead of the player to see if obstacles are in the way") { mode == FlyMode.Bounce && passObstacles }
9192
private val directionStep by setting("Direction Step", 45.0, 0.0..180.0, 0.1, "The step size to use when locking the flight direction") { mode == FlyMode.Bounce && passObstacles }
@@ -120,6 +121,10 @@ object ElytraFly : Module(
120121
}
121122
}
122123

124+
listen<TickEvent.Post> {
125+
if (glidePause > 0 && !applyPauseAfterBaritone) glidePause--
126+
}
127+
123128
onEnable {
124129
startPos = player.pos
125130
}
@@ -217,7 +222,7 @@ object ElytraFly : Module(
217222
return
218223
}
219224

220-
if (glidePause > 0) {
225+
if (glidePause > 0 && applyPauseAfterBaritone) {
221226
glidePause--
222227
return
223228
}

src/main/kotlin/com/lambda/module/modules/render/FreeLook.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ object FreeLook : Module(
3939
val togglePerspective by setting("Toggle Perspective", true, "Toggle perspective when enabling FreeLook")
4040

4141
var camera: Rotation = Rotation.ZERO
42-
var previousPerspective: Perspective = Perspective.FIRST_PERSON
42+
var previousPerspective: Perspective = mc.options.perspective
4343

4444
/**
4545
* @see net.minecraft.entity.Entity.changeLookDirection
@@ -54,8 +54,6 @@ object FreeLook : Module(
5454
}
5555

5656
init {
57-
previousPerspective = mc.options.perspective
58-
5957
onEnable {
6058
camera = player.rotation
6159
previousPerspective = mc.options.perspective

src/main/kotlin/com/lambda/module/modules/render/Nametags.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
package com.lambda.module.modules.render
1919

20+
import com.lambda.Lambda.mc
2021
import com.lambda.config.applyEdits
2122
import com.lambda.config.groups.EntitySelectionSettings
2223
import com.lambda.config.groups.ScreenTextSettings
@@ -114,12 +115,12 @@ object Nametags : Module(
114115
world.entities
115116
.sortedByDescending { it distSq mc.gameRenderer.camera.pos }
116117
.forEach { entity ->
118+
if (!shouldRenderNametag(entity)) return@forEach
117119
val textConfig =
118120
if (entity is PlayerEntity && entity.isFriend) friendTextConfig
119121
else otherTextConfig
120122
val textStyle = textConfig.getSDFStyle()
121123
val textSize = textConfig.size
122-
if (!shouldRenderNametag(entity)) return@forEach
123124
val nameText = entity.displayName?.string ?: return@forEach
124125
val nameWidth = FontHandler.getStringWidthNormalized(nameText, textSize)
125126
val box = entity.interpolatedBox
@@ -245,7 +246,8 @@ object Nametags : Module(
245246

246247
@JvmStatic
247248
fun shouldRenderNametag(entity: Entity) =
248-
entitySelectionSettings.isSelected(entity) && (entity !is LivingEntity || entity.isAlive)
249+
(entity !== mc.player || !mc.options.perspective.isFirstPerson) &&
250+
entitySelectionSettings.isSelected(entity) && (entity !is LivingEntity || entity.isAlive)
249251

250252
private enum class DurabilityMode(val text: Boolean, val bar: Boolean) {
251253
None(false, false),

0 commit comments

Comments
 (0)