Allow defining custom textures for a specific material
Closed this issue · 1 comments
When modifying tools/weapons with modded materials, the texture of each part it's just the default one with a changed color, this works for some modded materials, but some add items with different textures than vanilla.
My suggestion it's to use a custom texture for a specific material for a specific part if available (added by an addon or by a modpack creator), and otherwise fallback to a default texture with a changed color.
This would allow greater compatibility with mods and much more satisfaction when using modded materials or modifying modded items.
This is already fully possible, just badly documented xD
https://github.com/Truly-Modular/Armory/tree/master/common/src/main/resources/assets/miapi/models/item/armor/model/arm_left/base
when looking at the armor you can see how exactly it is done.
Basicly, in the module.json in the datapack you can define a path like
{
"name": "arm_left",
"texture": [
{
"path": "miapi:models/item/armor/model/arm_left/base/[material.texture].json",
....
this path is now material sensitive. if the material.key is found inside this path, it will use the material based model.
If a group of the material is found, it will use that. If none are found, it will use the default.json
In addition, while not used in any of the default addons, you can attach a mc-meta file to the model.json to tell it to not be grayscaled but direct color.
By default all model paths in all of our addons use this syntax, and i urge other addon developers todo the same
here you can see the effects of that, the left arms color provider is set to model, removing the material based color from it. we will update the wiki so people can understand all of this, but if you have any additional questions feel free to join the discord and ask.