N1nn1 / dye_depot

Enhances your Minecraft experience with 16 vibrant new dyes and various other tweaks
https://modrinth.com/mod/dye-depot
Other
11 stars 8 forks source link

Suggestion: on load automatic texture creation #33

Open InkDragon opened 5 months ago

InkDragon commented 5 months ago

I'm not a java programmer, i just know it can be done in other stuff(javascript, html, ect) so hopefully it can be done here.

What I'm suggesting is creating an image file for each dye, so that when overlaied over a white texture at say 75% opacity it produces the dye color on that texture. that new texture is then used as the new colored version of the item in game. it won't be 100% perfect, but it be an excellent way to provide universal compatibility until you can provide support for specific mods.

That way there are never any funky black & magenta boxes in game. Alternatively an option to disable any items without textures would be cool too

cactusdualcore commented 5 months ago

How would the items in need of texture autogeneration be determined?

InkDragon commented 5 months ago

How would the items in need of texture autogeneration be determined?

do checks for: does mod have dyed items? if yes is mod supported/does mod already have custom art? if not generate items find white item texture, clone texture and overlay with dye color to generate textures for generated items

this ideally would only need to be ran at minecraft world gen or world load, However it could be ran as often as every time the game starts. It could also skip over mods that have custom art already or check them for missing art depending on how it would be programmed.

sadly I'm not a java programmer else I'd happily write the code myself and submit it. I love the concept of this mod

cactusdualcore commented 5 months ago

does mod have dyed items?

How do you determine this?

cactusdualcore commented 5 months ago

So, I took a loot at the code just now, and Dye Depot achieves this out-of-the-box "semi-compatibility" with other Mods by patching DyeColor to include new variants. So any Mod that uses DyeColor::values will generate new variants of items and blocks. What you ask is

  1. Finding said items and blocks.
  2. Deduplicating said items into groups and finding the white variant.
  3. Find the white texture layer, if any.
  4. Overlay it with the semi-transparent colored textures .
  5. Make the textures, block and item models and blockstates back known to Minecraft.

Besides (4), which is "fairly simple" and (5) of which I have zero knowledge how easy or not that is, everything else requires a fair bit of engineering, purely to solve the problems at hand. To name a few