Skip to content

Properly calculate global BPE and add initial value for data palettes#910

Merged
eclipseisoffline merged 3 commits into
masterfrom
data-palette-fix
Sep 15, 2025
Merged

Properly calculate global BPE and add initial value for data palettes#910
eclipseisoffline merged 3 commits into
masterfrom
data-palette-fix

Conversation

@eclipseisoffline

Copy link
Copy Markdown
Member

This PR re-introduces custom global BPE (bits-per-entry) values for data palettes, however, instead of passing these directly, library users pass the size of the applying registry (block state or biome), and MCPL calculates the global BPE value necessary to store all of the values of that registry.

When creating an empty data palette, MCPL now uses a singleton palette instead of a list palette. This saves a bit of space. Library users also have to specify the initial value of the data palette, instead of this defaulting to whatever state is first set in the palette.

PaletteType.CHUNK has also been renamed to PaletteType.BLOCK_STATE for clarity. Related variables and parameters have also been renamed.

@onebeastchris onebeastchris left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm!

@basaigh basaigh left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm :)

@eclipseisoffline eclipseisoffline merged commit 75fd21a into master Sep 15, 2025
2 checks passed
@eclipseisoffline eclipseisoffline deleted the data-palette-fix branch September 15, 2025 11:10
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.

3 participants