mrkite / minutor

Mapping for Minecraft
http://seancode.com/minutor
BSD 2-Clause "Simplified" License
277 stars 51 forks source link

[Suggestion][1.16.4] Biome IDs from level.dat #241

Closed drakray closed 3 years ago

drakray commented 3 years ago

In 1.16.4, at least with forge installed, the Biomes numerical ID are store with their text ID in level.dat Could it be possible to have a .json file with only the text IDs, and have Minutor link those to numerical automatically?

This could allow for making and sharing a single ModdedBiomes.json, already set with BiomeName, color, temperature and humidity, without having to set the numerical ID each time.

Kind of like the Blocks.json, which no longer use numerical ID at all, so now I could for example make a bop_block.json and share it, and everyone who download it could have the color, transparency and foliage without going through the same pain XD

EtlamGit commented 3 years ago

Minutor provides Biome mapping for Vanilla Minecraft. Biomes are still stored as numerical ID in Minecraft.

To define your own Biomes you have to create a xyz_biomes.json with IDs (as you probably did).

How you get the information and fill that file depends on Mods you use. If Forge provides these information easy accessible, just write a converter tool from Forge-NBT to JSON and Minutor can use it.

drakray commented 3 years ago

Yeah in level.dat, there is a path to get all biomes and their respective ID, however I don't know what to use to easily extract stuff from NBT, other than opening it with NBTExplorer. Do you have any pointer that I could use with C#? I donl't have any problem with exporting stuff to JSON, just reading NBT.

Thanks :)

EtlamGit commented 3 years ago

NBTExplorer is a very good starting point. I always use it to figure out where to find stuff and data types used for the tags that are present.

Starting from that information you could use the nbt.cpp file here in Minutor as inspiration. It contains parsing and tree construction of NBT structures. All map/entity loading stuff here is just NBT tree traversal. You could just translate nbt.cpp to C#.

Maybe it is worth to look at mstefarov/fNbt but I did not test that code.