Hello,
I'm porting my mod over to 1.12 and I've bumped into a problem that I can't wrap my head around.
Due to the functionality of the mod, the texture names don't correlate to the item name. Instead, they correlate to an internal property of the items. That is all dealt with in the item.getModelLocation().
In the example, I have 2 books. One configured to be yellow, the other to be blue.
The println in the code tells me that the unlocalized name and the resource location match up perfectly, and if I change the model location up to an invalid string, it actually can't find the resources. So I know that I have the right values.
However, after this runs, both of my books become blue, which was the last texture to load. What am I missing?
@SubscribeEvent
public static void registerModels(ModelRegistryEvent event) {
for (final AchievementBookItem item : l2.items()) {
System.out.println(String.format("Setting %s to %s", item.getUnlocalizedName(), item.getModelLocation().toString()));
ModelLoader.setCustomModelResourceLocation(item, 0, item.getModelLocation());
ModelBakery.registerItemVariants(item, item.getModelLocation());
ModelLoader.setCustomMeshDefinition(item, new ItemMashes(item));
}
}