From 8621bebd9a38545a1f733a310e7cba7ab40caee6 Mon Sep 17 00:00:00 2001 From: TwinkNet <248537975+TwinkNet@users.noreply.github.com> Date: Tue, 10 Mar 2026 03:32:25 -0600 Subject: [PATCH 1/4] Implement biome view on Coordinates.kt --- .../com/lambda/module/hud/Coordinates.kt | 29 +++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/com/lambda/module/hud/Coordinates.kt b/src/main/kotlin/com/lambda/module/hud/Coordinates.kt index 5b72573db..805f15684 100644 --- a/src/main/kotlin/com/lambda/module/hud/Coordinates.kt +++ b/src/main/kotlin/com/lambda/module/hud/Coordinates.kt @@ -30,6 +30,7 @@ import com.lambda.util.extension.isNether import com.lambda.util.math.Vec2d import com.lambda.util.math.netherCoord import com.lambda.util.math.overworldCoord +import io.ktor.util.* object Coordinates : HudModule( name = "Coordinates", @@ -42,6 +43,7 @@ object Coordinates : HudModule( } private val showDimension by setting("Show Dimension Name", true) + private val showBiome by setting("Show Biome Name", true) // TwinkNet - Show biome private val showCurrentDimensionOnly by setting("Show Current Dimension Only", true) private val formatter = FormatterSettings(c = this, baseGroup = arrayOf(Group.CurrentDimension)).apply { @@ -66,10 +68,33 @@ object Coordinates : HudModule( else "$position $otherDimensionPos" val withDimension = - if (showDimension) "$text ${world.dimensionName}" + // TwinkNet start - show biome + if (showDimension && showBiome) "$text ${world.dimensionName} in" + else if (showDimension) "$text ${world.dimensionName}" + // TwinkNet end else text - textCopyable(withDimension) + // TwinkNet start - Show biome + val withBiome = + if (showBiome) "$withDimension ${beautifyBiome(world.getBiome(player.blockPos).idAsString)}" + else withDimension + // TwinkNet end + textCopyable(withBiome) } } + + // TwinkNet start - Show biome + fun beautifyBiome(biome: String): String { + val beautifulBiome = biome.replace(Regex("^.*:"), "").replace("_", " ") + // nuke the namespace key and underscores + val arr = beautifulBiome.toCharArray() + arr[0] = Character.toUpperCase(arr[0]) // first letter uppercase + for ((index, ch) in arr.withIndex()) { + if (ch == ' ') { + arr[index + 1] = Character.toUpperCase(arr[index + 1]) // uppercase every first letter of each word + } + } + return String(arr) + } + // TwinkNet end } From f281ae5d4540ebd9fb48a9bab78b230ca00488b0 Mon Sep 17 00:00:00 2001 From: TwinkNet <248537975+TwinkNet@users.noreply.github.com> Date: Tue, 10 Mar 2026 04:24:03 -0600 Subject: [PATCH 2/4] remove stupid comments and use native kotlin methods. --- .../com/lambda/module/hud/Coordinates.kt | 22 +++++-------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/src/main/kotlin/com/lambda/module/hud/Coordinates.kt b/src/main/kotlin/com/lambda/module/hud/Coordinates.kt index 805f15684..b7ca04465 100644 --- a/src/main/kotlin/com/lambda/module/hud/Coordinates.kt +++ b/src/main/kotlin/com/lambda/module/hud/Coordinates.kt @@ -30,7 +30,6 @@ import com.lambda.util.extension.isNether import com.lambda.util.math.Vec2d import com.lambda.util.math.netherCoord import com.lambda.util.math.overworldCoord -import io.ktor.util.* object Coordinates : HudModule( name = "Coordinates", @@ -43,7 +42,7 @@ object Coordinates : HudModule( } private val showDimension by setting("Show Dimension Name", true) - private val showBiome by setting("Show Biome Name", true) // TwinkNet - Show biome + private val showBiome by setting("Show Biome Name", true) private val showCurrentDimensionOnly by setting("Show Current Dimension Only", true) private val formatter = FormatterSettings(c = this, baseGroup = arrayOf(Group.CurrentDimension)).apply { @@ -83,18 +82,9 @@ object Coordinates : HudModule( } } - // TwinkNet start - Show biome - fun beautifyBiome(biome: String): String { - val beautifulBiome = biome.replace(Regex("^.*:"), "").replace("_", " ") - // nuke the namespace key and underscores - val arr = beautifulBiome.toCharArray() - arr[0] = Character.toUpperCase(arr[0]) // first letter uppercase - for ((index, ch) in arr.withIndex()) { - if (ch == ' ') { - arr[index + 1] = Character.toUpperCase(arr[index + 1]) // uppercase every first letter of each word - } - } - return String(arr) - } - // TwinkNet end + fun beautifyBiome(biome: String): String = biome + .substringAfterLast(':') + .replace('_', ' ') + .split(' ') + .joinToString(" ") { it.replaceFirstChar(Char::uppercaseChar) } } From 1c076f9997e949f9e3f6fdac4c45265075eb29bd Mon Sep 17 00:00:00 2001 From: TwinkNet <248537975+TwinkNet@users.noreply.github.com> Date: Tue, 10 Mar 2026 04:25:06 -0600 Subject: [PATCH 3/4] remove stupid comments --- src/main/kotlin/com/lambda/module/hud/Coordinates.kt | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/main/kotlin/com/lambda/module/hud/Coordinates.kt b/src/main/kotlin/com/lambda/module/hud/Coordinates.kt index b7ca04465..8363631b3 100644 --- a/src/main/kotlin/com/lambda/module/hud/Coordinates.kt +++ b/src/main/kotlin/com/lambda/module/hud/Coordinates.kt @@ -67,17 +67,13 @@ object Coordinates : HudModule( else "$position $otherDimensionPos" val withDimension = - // TwinkNet start - show biome if (showDimension && showBiome) "$text ${world.dimensionName} in" else if (showDimension) "$text ${world.dimensionName}" - // TwinkNet end else text - // TwinkNet start - Show biome val withBiome = if (showBiome) "$withDimension ${beautifyBiome(world.getBiome(player.blockPos).idAsString)}" else withDimension - // TwinkNet end textCopyable(withBiome) } } From 354774db64947f91307fdc30424fca10b554abb1 Mon Sep 17 00:00:00 2001 From: TwinkNet <248537975+TwinkNet@users.noreply.github.com> Date: Tue, 10 Mar 2026 04:32:31 -0600 Subject: [PATCH 4/4] Coordinates - always prepend "in" --- src/main/kotlin/com/lambda/module/hud/Coordinates.kt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/com/lambda/module/hud/Coordinates.kt b/src/main/kotlin/com/lambda/module/hud/Coordinates.kt index 8363631b3..dcc9b7360 100644 --- a/src/main/kotlin/com/lambda/module/hud/Coordinates.kt +++ b/src/main/kotlin/com/lambda/module/hud/Coordinates.kt @@ -67,12 +67,11 @@ object Coordinates : HudModule( else "$position $otherDimensionPos" val withDimension = - if (showDimension && showBiome) "$text ${world.dimensionName} in" - else if (showDimension) "$text ${world.dimensionName}" + if (showDimension) "$text ${world.dimensionName}" else text val withBiome = - if (showBiome) "$withDimension ${beautifyBiome(world.getBiome(player.blockPos).idAsString)}" + if (showBiome) "$withDimension in ${beautifyBiome(world.getBiome(player.blockPos).idAsString)}" else withDimension textCopyable(withBiome) }