-
Notifications
You must be signed in to change notification settings - Fork 424
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
Datagen generating redundant item models, even though it shouldn't. #4303
Comments
I'm pretty sure this is a vanilla feature. |
So mixing in the vanilla methods is the answer? |
no, calling BlockStateModelGenerator#excludeFromSimpleItemModelGeneration in your ModelProvider's generateBlockStateModels method is |
Quoted |
I forgot to mention that I use 1.21.4, in which this method no longer exist, so far with no replacement. |
1.21.4 uses item asset generation. are you manually generating your item model definition files? this should have no issues with your own models as you can datagen the item model definitions without generating the model and it wont automatically generate a model either. it sounds like this is not a models issue but an item model definition issue where you manually generate your item model definition (assets/namespace/items/youritem.json) rather than the model itself (assets/namespace/models/item/youritem.json) fabric api already filters out autogenerating stuff from mods other than your own. I could see this beaing a feature request for an item model definition exclusion as well added to the FabricModelProvider |
I wrote the JSON item model definitions by hand, because I wanted to have them tinted. When I tried generating them with the tint, it generated both the tinted version and the default redundant JSON. |
This seems to work fine for me when generating a tinted layered item model and item model definition. // register a normal layer0 item model.
Models.GENERATED.upload(item, TextureMap.layer0(item), itemModelGenerator.modelCollector);
// register the item model definition
itemModelGenerator.output.accept(item,
ItemModels.tinted(ModelIds.getItemModelId(item), new DyeTintSource(8606770))
); or if you are using the block model with a tintsource // the block model would be generated from the "generateBlockStateModels" method already
// just register the item model definition pointing to the block model
itemModelGenerator.output.accept(item,
ItemModels.tinted(ModelIds.getBlockModelId(block), new DyeTintSource(8606770))
); |
Github repo
Hi, I've come across this when using my ModelProvider. I've normally added a few new blocks, to which I wanted to do the item and block models manually (vertical grass slab and stairs to be exact). But when I did that and ran the datagen, it generated item models for those blocks, even though they're not in my ModelProvider.
Here are steps to reproduce this issue:
I have a few custom datagen methods, tho it shouldn't be them. I tested this in my other mod without such methods, and had the same problem.
The text was updated successfully, but these errors were encountered: