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

ProtocolBlockTypePalette merged to BlockTypePalette #4431

Merged
merged 3 commits into from Dec 28, 2019

Conversation

madmaxoft
Copy link
Member

@madmaxoft madmaxoft commented Dec 2, 2019

The two objects were almost identical in functionality, so they were merged into a single one.

Fixes #4381.

@madmaxoft madmaxoft marked this pull request as ready for review December 2, 2019 20:22
@madmaxoft madmaxoft force-pushed the ProtocolBlockTypePaletteMerge branch 2 times, most recently from 2425fe7 to a0c4b0b Compare December 20, 2019 21:20
@madmaxoft
Copy link
Member Author

This is now ready for review.
The main points are:

  • ProtocolBlockTypePalette functionality has been moved to BlockTypePalette and the ProtocolBlockTypePalette type removed completely
  • BlockTypePalette can load the palette from strings / files, in three formats (described in the header):
    • blocks.json, as produced by vanilla server (so that new protocols' palettes can be added simply by users, rather than having to wait for us)
    • Regular TSV, a somewhat stripped version of the same data, produced by $/Tools/BlockTypePaletteGenerator; this file type is better suited for storage in the repository, rather than the raw blocks.json (550 KiB instead of 1.4 MiB; and avoiding possible copyright issues from Mojang)
    • Upgrade TSV, a special version of the regular TSV that uses BlockType + BlockMeta representation for the numeric IDs and is meant for upgrading pre-1.13 worlds (generated from Minutor data)

Note that the class is not yet used by the main codebase, so the only client code for it is the tests. THe first usage will come in a subsequent PR.

Copy link
Member

@NiLSPACE NiLSPACE left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't look at the huge files as I suspect they are generated. :)

@madmaxoft madmaxoft merged commit 2d6f6a5 into master Dec 28, 2019
@madmaxoft madmaxoft deleted the ProtocolBlockTypePaletteMerge branch December 28, 2019 21:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create an upgrade table for blocks
2 participants