Everything posted by Mekelaina
-
[1.12.2] Item textures not loading for items that change texture with nbt data.
@diesieben07 I realize this now. I'll change it soon enough
-
[1.12.2] Item textures not loading for items that change texture with nbt data.
@Draco18s THANK YOU SO MUCH! I got it to work thanks to your code. And yes, I agree IHasModel is a terrible way of doing this, but what it does is every block and item is added to an ArrayList upon initialization and then in my registry handler class ( I realize now I didn't link to this originally and I apologize) loops through each item, block, etc. and runs its corresponding initialization method. This is what registers my models as of rn: @SubscribeEvent public static void onModelRegister(ModelRegistryEvent event) { for(Item item : ModItems.ITEMS) { if(item instanceof IHasModel) { ((IHasModel)item).registerModels(); } } for(Block block : ModBlocks.BLOCKS) { if(block instanceof IHasModel) { ((IHasModel)block).registerModels(); } } // ModItems.initSpecialModels(); } I set it up this way because that's how the tutorial I followed at the time did it. I realize this is a dumb setup and I'll go back and change it at some point, but this works for now. This mod project of mine is actually my first attempt at it and I'm trying to self-teach myself the more complex stuff of modding. I actually really like your registry class setup and will definitely take inspiration from it for the future! Again, TYSVM!
-
[1.12.2] Item textures not loading for items that change texture with nbt data.
So, Turns out I misspelled one of my interface methods. registerModel() when it should have been registerModels(). So, All the models loaded (i think) when I added this bit to the corrected method public void registerModels() { //System.out.println("wdjlmnojvn"); ModelBakery.registerItemVariants(this, CardImages.CARD_MODELS.values().toArray(new ModelResourceLocation[CardImages.CARD_MODELS.size()])); ModelLoader.setCustomMeshDefinition(this, new CardItemMesh()); } However, Now the models are just... not the models they're supposed to be. They're now the default broken cube model. So not the "cube_all" model but this. @Draco18s
-
[1.12.2] Item textures not loading for items that change texture with nbt data.
So, I'm working on implementing trading cards into the game, but I cant get my textures to load properly. I know it's an issue with trying to get multiple textures and models for one "item" as everything else works. In fact, the model that does get loaded at least half works as the back of the card render fine, see here. I'm really lost here. Minecraft doesn't throw any errors. Can anyone help me out? The relevant section of my main class: @EventHandler public static void preInit(FMLPreInitializationEvent event) { //CONFIG_DIRECTORY = Minecraft.g config = new Configuration(event.getSuggestedConfigurationFile()); config_dir = event.getModConfigurationDirectory().getAbsolutePath(); CardLoadingHandler.loadCardInfo(); CardImages.init(); } My Item: https://pastebin.com/bKePKbQr My Custom Item Mesh: https://pastebin.com/FwhjMjww My Card ModelResourceLocation holding class https://pastebin.com/Ck9ZYSxt And my card collection class: https://pastebin.com/vQASnk7k