feat: Extract proper registry data from vanilla datapack #195
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Finally, the entire world is a plains biome!
Jokes aside, what this patch does is as follows: It expands the amount of data extracted from the official server to include the vanilla datapack registries, and adds code to parse them at run-time from the file system. This means the application now has a much better understanding of the knowledge shared by both the server and client.
For instance, when upgrading to a new version of Minecraft, I would previously have to capture the flow of Registry Data packets from a real server, which CobolCraft would then re-play as a blob. Any data within that packet, such as biome IDs or chat message types, would need to be hard-coded where they were needed, since the server-side aspects of the data would simply be missing.
Now, with the "--server" flag added in the Makefile, JSON files are exported for every vanilla registry entry. Using newly-implemented C++ routines to obtain directory listings (why is this not part of GnuCOBOL?), the registries can be filled in at run-time. The Registry Data packet now sends the actual data instead of an opaque blob.
As a proof-of-concept, the new methods are used to lookup the "minecraft:plains" biome at chunk allocation such that we get a much nicer tint of the environment (compared to "minecraft:badlands", which happened to be the default ID 0 when using the blob).