Fix incorrect skyColor in BiomesDataGenerator#66
Fix incorrect skyColor in BiomesDataGenerator#66extremeheat merged 1 commit intoPrismarineJS:bumpfrom
Conversation
|
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 |
|
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. |
|
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 |
|
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 |
There was a problem hiding this comment.
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
& 0xFFFFFFmask to skyColor value to strip alpha channel and ensure only RGB components remain
|
I see, thanks for the codelinks. Seems like there is no alpha value for the colors in the data beyond added at runtime |
* 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>
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