#Armor Model Generator for 1.21.5

30 messages · Page 1 of 1 (latest)

onyx verge
#

hello. Anyone familiar with armor model generators on datagen?

Am I correct? in 1.21.5, the ItemModelGenerator#registerArmor does not care about the euipment type any more? in other words, is doesn't matter if we are registering a helmet or a leggings any more?

so, will this generate the armor models correctly?

public static void generateArmorModel(String modID, ItemModelGenerator generator, Item armor, ArmorMaterial material, boolean dyeable)//, EquipmentType slot, boolean dyeable)
{
    Identifier id = material.assetId().getValue();
    String name = Registries.ITEM.getId(armor).getPath();
    RegistryKey<EquipmentAsset> key = RegistryKey.of(RegistryKey.ofRegistry(Identifier.ofVanilla("equipment_asset")), identifier(modID, name));
    generator.registerArmor(armor, key, id, dyeable);
}```
flint hill
#

Armor models or item armor models ?

onyx verge
#

armor models in the item model data gen the part that generates the jsons needed for the armor itself

#

the code above adds the armor to the ItemModelGenerator, the 1.21.4 code did not ask for the RegistryKey<EquipmentAsset> and instead it was using the EquipmentType, what I want to know, is that would the changes I made in the code work? And also, have a question, how does Minecraft understand the type of equipment from the key without the type now? Or, does it care about the type at all or did they change things in the background in such a way that it doesn't care about the type any more?

flint hill
onyx verge
#

generateArmor? where is that method?

#

did you look into ItemModelGenerator#registerArmor ?

Also one more question, in 1.21.3 (I think) Minecraft team introduced new set of json files that should sit in the assets equipment folder, do we have any datagen ready to make those json files now?

flint hill
flint hill
#

Oh right 🥲

#

I forgot the assets registrykeys

onyx verge
#

so it looks like we both are doing the same thing but in different ways?

flint hill
#

Well you need to give the armortype afaik

onyx verge
#

honestly I'm not sure, the model generator method does not need the armor type any more! it looks like datagen stuff changed a lot for models. This is the worst part in any update, vanilla really has not enough examples for datagen

flint hill
#

it does in the sourcecode 😭

#

also yes in 1.21.4 and 1.21.5 its diff a bit bcz they added fields for them in 1.21.5

#

show the method you use

onyx verge
flint hill
#

it is an external library

#

yes

onyx verge
#

do you remember the name? because the net minecraft source has very little in it

flint hill
#

these 2 contain the sourcecode

onyx verge
#

will look inot them. thanks

onyx verge
#

but even in that library, I can't find how many different things are using datagen, for example, armor or even furnace!

flint hill
#

then if you extend the vanilla classes middle click on them and it will bring you to the vanilla class and you can search for the stuff you need

onyx verge
#

I know all of this. what i neglected, was looking into the client/data folder. I think the one library I have is the combination of your libraries, do you use split mod dev env?

flint hill
#

i use split sources yes