Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion: on load automatic texture creation #33

Open
InkDragon opened this issue Jun 3, 2024 · 4 comments
Open

Suggestion: on load automatic texture creation #33

InkDragon opened this issue Jun 3, 2024 · 4 comments

Comments

@InkDragon
Copy link

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
Copy link

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

@InkDragon
Copy link
Author

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
Copy link

cactusdualcore commented Jun 4, 2024

does mod have dyed items?

How do you determine this?

@cactusdualcore
Copy link

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

  • What criteria should be used to find colored blocks? Recipes? Registry names? Usage of DyeColor::values?
  • There is no enforced way to layout color overlay textures on disk. Actually, nothing keeps you from having 16 different textures.
  • How can the "same block of different colors" be identified? White Wool and Green Wool, for example, programmatically are barely related.

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

No branches or pull requests

2 participants