-
-
Notifications
You must be signed in to change notification settings - Fork 179
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
Allow datagen to use vanilla armor trim textures #146
Allow datagen to use vanilla armor trim textures #146
Conversation
Honestly, I don't think this is a bad solution since we have |
I'll have to look into that then. We're entering an area I'm not too familiar with so it may take me a little bit to get familiar with it. Will mark as a draft until I get this fully figured out. In order to switch to changing the ExistingFileHelper instead I need to make sure that this will also work with any generated resources mods make as well, not just vanilla. I'm sure there's mods out there that have their own systems to do this, or some may use vanilla's system in the future at some point. |
Yeah, the correct solution, imo, would be to use |
Thank you for letting me know about this! I'm very glad I didn't have to cobble something up myself. |
src/main/java/net/minecraftforge/client/model/generators/ItemModelBuilder.java
Outdated
Show resolved
Hide resolved
afcf257
to
cc30f47
Compare
I've updated this PR to 1.20.2, feel free to look it over whenever :) |
1.20 introduced armor trims, which use dynamically generated textures for the armor overlay based on what material is used. Unfortunately, since these textures don't exist until the game is actually run, there's not an easy way to add textures like these to item models, as the ModelBuilder's
texture
method checks that the texture actually exists.This PR aims to fix that in an easy way, by adding a new
uncheckedTexture
method to the ModelBuilder. Using this method won't make the ModelBuilder check if the texture actually exists when generating an item model, allowing you to add things like trim overlays to your armors using datagen.I chose to name it
uncheckedTexture
because models use a similar naming convention with UncheckedModelFile, which doesn't check if a model actually exists when using it in datagen. If anyone has a better name proposal, please let me know and I'll change it.I also added to the existing
DataGeneratorTest
to show that the method works as intended. SwitchinguncheckedTexture
to just usetexture
will throw an error since the texture doesn't actually exist when it's called.