Skip to content

Fix incorrect skyColor in BiomesDataGenerator#66

Merged
extremeheat merged 1 commit intoPrismarineJS:bumpfrom
SuperGamerTron:bump
Feb 4, 2026
Merged

Fix incorrect skyColor in BiomesDataGenerator#66
extremeheat merged 1 commit intoPrismarineJS:bumpfrom
SuperGamerTron:bump

Conversation

@SuperGamerTron
Copy link
Contributor

Incorrect color format was causing the color property in biomes.json to be negative as seen here: https://github.com/PrismarineJS/minecraft-data/blob/15a9880b4b06118ccbdc4f20463582a8410b3295/data/pc/1.21.11/biomes.json

@extremeheat
Copy link
Member

You are clamping the number. How does this fix? What is in those upper bits? The only way I can see an overflow is if the color is i64

@SuperGamerTron
Copy link
Contributor Author

Minecraft now represents colors in json as RGB hex values, which is converted to an opaque/transparent ARGB value before read/write in the codec, so we have to run the transparency operation to get the accurate color.

@extremeheat
Copy link
Member

What I mean is that your change doesn't make sense even with RGBA. That's still i32. And I don't see why we shouldn't include alpha channel for color if it's included in vanilla as part of data. Question is, is it overflowing? Because it shouldn't

@extremeheat
Copy link
Member

Actually the problem looks to be the cast to integer. That's clamping to a u32 value into signed i32. So seems the fix should be to not do the cast

@SuperGamerTron
Copy link
Contributor Author

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes incorrect negative color values in biomes.json for Minecraft 1.21.11 by properly masking the sky color to RGB format. The issue arose because Minecraft 1.21.11 changed the API from biome.getSkyColor() to EnvironmentAttributes.SKY_COLOR, and the new API returns integers that include alpha channel bits which need to be masked off.

Changes:

  • Applies & 0xFFFFFF mask to skyColor value to strip alpha channel and ensure only RGB components remain

@extremeheat
Copy link
Member

I see, thanks for the codelinks. Seems like there is no alpha value for the colors in the data beyond added at runtime

@extremeheat extremeheat merged commit 7609276 into PrismarineJS:bump Feb 4, 2026
36 of 37 checks passed
extremeheat added a commit that referenced this pull request Feb 19, 2026
* Add version 1.21.11

* Fix 1.21.11 compilation errors from Minecraft API changes (#65)

* Initial plan

* Fix 1.21.11 compilation: Replace ResourceLocation with Identifier and update WaterAnimal/getSkyColor

Co-authored-by: extremeheat <13713600+extremeheat@users.noreply.github.com>

* Add type-safe instanceof check before casting sky color argument

Co-authored-by: extremeheat <13713600+extremeheat@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: extremeheat <13713600+extremeheat@users.noreply.github.com>

* Fix incorrect biome color representation (#66)

* Fix water_creature entities no longer being classified correctly (#67)

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: extremeheat <13713600+extremeheat@users.noreply.github.com>
Co-authored-by: SuperGamerTron <45374546+SuperGamerTron@users.noreply.github.com>
Co-authored-by: Paul Fulham <paul.fulham0@gmail.com>
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