Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Add commas to energy stored in fusion reactors. #151

Open
royalmustard opened this issue May 23, 2021 · 2 comments
Open
Labels
enhancement New feature or request

Comments

@royalmustard
Copy link

By adding commas ever 3 digits, the amount of energy stored in fusion reactors should become way more readable.

@Exaxxion Exaxxion added the enhancement New feature or request label May 28, 2021
@Exaxxion
Copy link
Collaborator

I agree that some manner of formatting would be useful here, but it should be implemented using locale-sensitive number formatting rather than specifically commas.

@warjort
Copy link

warjort commented Jun 11, 2021

The normal way to do this would be:

I18n.format("translation.key", number);

where the translation key is

translation.key=EU %,d

The %,d will automatically add the locale specific separator.

Unfortunately, this only works on the client.
For multiblocks, the screen output is constructed on the server which means you have to do:

new TextComponentTranslatable("translation.key", number);

But TextComponentTranslatable doesn't support %,d
I don't know why, but somebody at mojang decided to trap this formatting and other formatting and convert it to %s

You can't even subclass TextComponentTranslatable because the network serialization is hardwired.

It might be possible to write a coremod that changes the allowable formats by changing the final variable
TextComponentTranslatable.STRING_VARIABLE_PATTERN
but who knows what that would break?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants