-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Extract registries data from server.jar (#58)
To allow players to place arbitrary blocks and use any of the items the game has to offer, we need access to a list of these things. Fortunately, this data is available from the official Minecraft server .jar file via an integrated command-line interface. This patch adds a Makefile target that downloads the .jar and extracts relevant data from it, resulting in multiple JSON files. Furthermore, this patch adds a handmade JSON parser that is used to parse the "registries.json" file at run-time. The JSON parser is covered by unit tests. The registries data is not yet widely used, but as a proof-of-concept, the protocol ID of the player entity type is now extracted from it instead of being hardcoded. This, along with future patches, will greatly reduce the amount of work needed to support additional features and perform version upgrades. Finally, this patch overhauls the Dockerfile such that the data extraction can be performed at build time, while keeping a slim final image with only the relevant parts.
- Loading branch information
Showing
11 changed files
with
1,365 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
.idea | ||
*.so | ||
/cobolcraft | ||
/data | ||
/test | ||
/test.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.