Skip to content

Feat: option to view biome name in Coordinates.kt (HUD elem)#264

Open
TwinkNet wants to merge 4 commits intolambda-client:1.21.11from
TwinkNet:TwinkNet/BiomeHud
Open

Feat: option to view biome name in Coordinates.kt (HUD elem)#264
TwinkNet wants to merge 4 commits intolambda-client:1.21.11from
TwinkNet:TwinkNet/BiomeHud

Conversation

@TwinkNet
Copy link

Description

Implements a new option for the Coordinates HUD module called "Show Biome Name" that will append a beautified biome name in your coordinates module.

Checklist Before Submitting

To ensure the quality and maintainability of your PR, confirm the following before submission:

  1. Code adheres to the project's style guide and conventions. Check
  2. All tests pass, including newly added tests. Check
  3. Documentation has been updated to reflect any new features or changes. I added comments
  4. Your PR is limited to a single purpose, avoiding unrelated changes. Check

@TwinkNet
Copy link
Author

With dim view enabled:
image
Without:
image

}

private val showDimension by setting("Show Dimension Name", true)
private val showBiome by setting("Show Biome Name", true) // TwinkNet - Show biome
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line comment is not necessary. This is not a paper server patch.


val withDimension =
if (showDimension) "$text ${world.dimensionName}"
// TwinkNet start - show biome
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same with these comments and all below

}

// TwinkNet start - Show biome
fun beautifyBiome(biome: String): String {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function can be refactored to be more readable and in line with native kotlin methods.

fun beautifyBiome(biome: String): String = biome
	.substringAfterLast(':')
	.replace('_', ' ')
	.split(' ')
	.joinToString(" ") { it.replaceFirstChar(Char::uppercaseChar) }

@TwinkNet
Copy link
Author

fixed yeah sorry i've never written kotlin before

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants