Trying to figure out the new texture/model system, and I have a metadata block with a different model for each metadata. Block rendering is working just fine, got the variants (one file) and block model definition json files (one for each metadata) set up. But I had some trouble getting the item models to work, since the item json can only use one block json as its parent. I fiddled around for a while and managed to get it working with this code:
Item itemBlock = Item.getItemFromBlock(blockMulti);
for(int i = 0; i<5; i++) {
ModelBakery.addVariantName(itemBlock, Constants.MOD_ID + ":" + BlockMulti.NAME + i);
}
for(int i = 0; i<5; i++) {
mesher.register(itemBlock, i, new ModelResourceLocation(Constants.MOD_ID + ":" + BlockMulti.NAME + i, "inventory"));
}
So basically adding variants of name modid:blockname<metadata value> and then registering each metadata with ModelResourceLocation's of the same name. So in my case I have blockMulti0.json-blockMulti5.json in my models/item folder, each using a respective block json as its parent. And this worked, but I'm not quite sure if this is the correct way. The log also shows that it still tries to search for a blockMulti.json file, even though I'm not registering that.