Simplify model definition API #76
Wong-Innovations
started this conversation in
Draft
Replies: 2 comments
-
I don't agree with you 100%. {
"parent": "item/generated",
"textures": {
"layer0": "your_mod_id:item/base_texture"
},
"overrides": [
{
"predicate": { "custom_model_data": 0},
"model": {
"parent": "item/generated",
"textures": {
"layer0": "your_mod_id:item/base_texture#variant=0"
}
}
},
{
"predicate": { "custom_model_data": 1},
"model": {
"parent": "item/generated",
"textures": {
"layer0": "your_mod_id:item/base_texture#variant=1"
}
}
}
]
} It doesn't take a lot of effort, but it's a lot better than a I have made a draft here : https://github.com/Ecdcaeb/Cleanroom/tree/internalModel |
Beta Was this translation helpful? Give feedback.
0 replies
-
Resource(Data)Gen and Json Macro ? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Summary
Unless overridden by a model.json, ModelResourceLocations mapped to items/meta values should automatically be baked as the said item's in-game texture.
Goals
Reduce the amount of boiler plate model.json that get's written for single textured items and items which have only a single texture image per meta variant.
Non Goals
This is not a completely replacement for the existing API, but rather as an optional for the modder to handle model definitions.
Motivation
I've been trying to create an API where additional meta variants can easily be added to their source item (even from other mods). This is possible with item registration and works in game but the biggest downfall is mapping textures. Since forge looks for a single model.json file which explicitly defines all mappings between meta variant and textures additional variants to an item added by external mods would have no way to add their model locations to an existing model.json.
Description
I've been searching for a way to do this in 1.12 and it just doesn't seem possible. When I register ModelResourceLocations to variants of an item, as long as I have PNGs at the resource location specified minecraft should be able to figure out that is the texture I'm assigning the variant. I shouldn't need to create a model.json for the item that manually maps each variant to it's texture like so:
The fallback if there is a valid location at textures/items/item#variant should be to assume a basic model.json for each variant as pictured below:
Dependencies
No response
References
No response
Guidelines
Beta Was this translation helpful? Give feedback.
All reactions