You're in Grave Danger

You're in Grave Danger

17M Downloads

World aliases?

deluxghost opened this issue ยท 8 comments

commented

I would like to have alternative names for worlds, like colored or translated world names, instead of only "Overworld".

Is this even possible? Is there another way to achieve this?

Maybe a hashmap config for worlds like this?

{
    "overworld": "The FOO",
    "nether": "The BAR"
}
commented

Yeah I could probably do something with resource packs that could do this. I'll try to put it in the next update!

commented

I added this feature so you can change with a resource pack in <resourcepack>/assets/yigd/texts/dim_names.json. I'll try to push myself to update the wiki, but in the meantime I changed the names of the dimensions so they include which mod they come from now (minecraft:overworld instead of overworld). Other than that your example should work.

Anyway thank you for the suggestion. This allowed me to make the GUI look a little cleaner while still assuring it being even more specific (if there would be 2 dimensions with the same name from different mods now you can make the names different)
New version available at curseforge, modrinth, and github

commented

I'm using some method I found online to read the json file, which I honestly don't fully understand. What matters to me is that it works and I actually get data. For the encoding I have no idea how I could change it to use utf-8.
Also having the notifications change may actually be harder than you would think. Messages are sent to the player from the server, so data can easily be sent over without annoying packets and stuff. And the text resource is loaded from a resource pack, which means it's only loaded on the client. If I would attempt to translate the world name with the text file, that would crash servers. So I hope you understand me when I say I probably won't change anything with this at the moment

commented
  1. looks like dim_names.json doesn't use utf-8 encoding? i must change that file to windows local (ansi) encoding (gbk for zh-cn) to make it work
  2. some notifications like the grave spawned message can also use the new aliases (I didn't check other strings yet)
    image
commented

Encoding issue:
OK I got it, try changing:

new InputStreamReader(stream)

to

new InputStreamReader(stream, StandardCharsets.UTF_8)

(Yes, other json file might also have this problem)

Notification issue:
I see

commented

Damn now I feel lazy for not trying to figure this out myself! Thanks a bunch! I'll update the 1.19 version as soon as I get ftb chunks compat working again. Let me know if you want this in the 1.18.2 release too, but if not I'll let you know when I update

commented

I didn't actually build and test it yet, but it looks like the correct way

I'm using 1.19.0. Since 1.18.2 also has world aliases feature, we'd better port this change too, so they have identical behavior.

commented

Sorry for taking so long. Idk if you just made a version of this manually but I've released a 1.18.2 and 1.19.2 version with this feature now