Here's a console dump when I put "pipe/pipe01". In the preInit method of the item render register, I registered the variants like so: "[MODID]:pipe/pipe01" instead of
"[MODID]:pipe01"
This is the console dump when the variants are "[MODID]:pipe01"
And this is the console dump when both the variant and registration functions get "[MODID]:pipe01"
Note that when the locations are set to "[MODID]:pipe/pipe01" the console doesn't generate the "model location not found" issue. I would assume that this means that the file paths for the items are correct, yet when I run it minecraft doesn't render the model and textures.
And if it helps, here is my ItemRenderRegister class
package com.bedrockminer.tutorial.client.render.items;
import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.model.ModelBakery;
import net.minecraft.client.resources.model.ModelResourceLocation;
import net.minecraft.item.Item;
import javax.swing.JOptionPane;
import com.bedrockminer.tutorial.Main;
import com.bedrockminer.tutorial.blocks.ModBlocks;
import com.bedrockminer.tutorial.items.ModItems;
public final class ItemRenderRegister {
public static void preInit() {
ModelBakery.addVariantName(ModItems.metaItem, "tutorial:meta_item_white", "tutorial:meta_item_black");
ModelBakery.addVariantName(ModItems.connectorItem, "tutorial:pipe01", "tutorial:pipe02");
}
public static void registerItemRenderer() {
reg(ModItems.tutorialItem);
reg(ModItems.metaItem, 0, "meta_item_white");
reg(ModItems.metaItem, 1, "meta_item_black");
reg(ModItems.connectorItem, 0, "pipe/pipe01");
reg(ModItems.connectorItem, 1, "pipe/pipe02");
}
//==========================================================================
public static String modid = Main.MODID;
public static void reg(Item item) {
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(modid + ":" + item.getUnlocalizedName().substring(5), "inventory"));
}
public static void reg(Item item, int meta, String file)
{
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, meta, new ModelResourceLocation(modid + ":" + file, "inventory"));
//JOptionPane.showMessageDialog(null, modid + ":" + file);
}
}