Posted January 4, 201510 yr Even after reading this and this, I still don't quite get how Forge uses these files, and I couldn't find that much other documentation on the new system. I.e. what is happening when I declare blockstates? How does Forge know what new variant names to look for? What is the actual class that interacts with and parses .json files? And so on. For the people who do know, can you share a link to some resources that you think are helpful? GitHub|Recipe API Proposal
January 5, 201510 yr Hi You might find this link useful greyminecraftcoder.blogspot.com.au/p/list-of-topics.html in particular the topics under Blocks and Items ModelBakery.addVariantName is used to register for variants. For items you also need to Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register() to tell minecraft that the item renderer should look for the model in ModelManager. Vanilla methods that are particularly relevant: ModelManager.onResourceManagerReload() BlockModelShapes.reloadModels() and especially ModelBakery.getModelBlockDefinition() is the entry point for parsing JSON files. ModelBakery.bakeModel() The vanilla code is quite complex and will probably take a while to get your head around. If you just want an example of some working code, this project has some examples of block variants and item variants (examples 3 and 11) https://github.com/TheGreyGhost/MinecraftByExample -TGG
January 5, 201510 yr Author Thanks. I mainly wanted to see if it was possible to add a "default" tag to the .json files so that you don't have to specify the same thing multiple times (like the default case in a switch statement). For example, for a block, I'd want to have something like this: { "parent": "block/cube", "textures": { "down": "top_texture", "up": "top_texture", "default": "side_texture" } } GitHub|Recipe API Proposal
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.