Skip to content

Commit 7b83779

Browse files
authored
biome name in coordinates (#264)
1 parent cb97e62 commit 7b83779

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/main/kotlin/com/lambda/module/hud/Coordinates.kt

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ object Coordinates : HudModule(
4242
}
4343

4444
private val showDimension by setting("Show Dimension Name", true)
45+
private val showBiome by setting("Show Biome Name", true)
4546
private val showCurrentDimensionOnly by setting("Show Current Dimension Only", true)
4647

4748
private val formatter = FormatterSettings(c = this, baseGroup = arrayOf(Group.CurrentDimension)).apply {
@@ -69,7 +70,16 @@ object Coordinates : HudModule(
6970
if (showDimension) "$text ${world.dimensionName}"
7071
else text
7172

72-
textCopyable(withDimension)
73+
val withBiome =
74+
if (showBiome) "$withDimension in ${beautifyBiome(world.getBiome(player.blockPos).idAsString)}"
75+
else withDimension
76+
textCopyable(withBiome)
7377
}
7478
}
79+
80+
fun beautifyBiome(biome: String): String = biome
81+
.substringAfterLast(':')
82+
.replace('_', ' ')
83+
.split(' ')
84+
.joinToString(" ") { it.replaceFirstChar(Char::uppercaseChar) }
7585
}

0 commit comments

Comments
 (0)