MehVahdJukaar / polytone

Other
46 stars 5 forks source link

Add default foliage/water color when world is not loaded #102

Open Naezr opened 4 weeks ago

Naezr commented 4 weeks ago

I use a resourcepack that, with Polytone, makes items in inventory use the colour of the current biome.

In the game itself this works perfectly, but in the flat world customisation menu (and in any other cases where the world is not loaded) items are coloured white, as there is no biome.

Suggestion: Assign a default biome for the main menu, such as a plains, so that items are coloured in its colours and not white.

Screenshot:

изображение

Resourcepacks I'm using: https://modrinth.com/user/mineland

MehVahdJukaar commented 4 weeks ago

You are correct, you say "as if there is no biome", that's precisely because there isn't. Biomes ara data driven and are loaded with a world as they do depend on the world data, in fact the biome definition itself is IN the world data so to say, as all datapacka do. This means that there exactly are NO biome objects before a world is loaded

MehVahdJukaar commented 4 weeks ago

All colormaps do support a default color thing is I cannot load their definition yet as their internals depend on biomes

Naezr commented 4 weeks ago

This means that there exactly are NO biome objects before a world is loaded

That sounds like a lead. I don't know how this mod works, and I'm probably going to say some nonsense, but still. Is it possible to add a check to the function that gets the biome color to see if it's missing? As far as I guess, the mod tries to color these white textures with the biome color, and if it fails, no coloring occurs. That is, the biome color variable is zero or something like that. Is it possible to add a check for this and implement some kind of default color instead of zero?

Once again, I don't know much about Minecraft modding or Java, so don't take this too seriously.

MR-CHOO commented 2 weeks ago

It’s most likely bug with the pack that you are using, when no biome is loaded it will load a color from the colormap, I’m not sure from which value though, might be 256 at the end. Anyways whichever value it’s loading it probably just white on the colormap in the pack. I’ll have to test this with my pack later though to confirm.