Posted May 3, 20205 yr Hi there, I know I can load an existing block model like: BlockRendererDispatcher blockRenderer = Minecraft.getInstance().getBlockRendererDispatcher(); IBakedModel bakedModel = blockRenderer.getBlockModelShapes().getModel(state); IModelData data = bakedModel.getModelData(world, pos, state, ModelDataManager.getModelData(world, pos)); blockRenderer.getBlockModelRenderer().renderModel(world, bakedModel, state, pos, matrixStackIn, bufferIn.getBuffer(Atlases.getSolidBlockType()), false, new Random(), 42, combinedOverlayIn, data); What I'm wondering is how I can load a model that doesn't have an associated item, block or entity? No signature for you!
May 3, 20205 yr What is it you're trying to do? Is it going to be an entity, item, or what? You can load jsons, objs, b3ds, or if you've got it set up in a java class, that works well too. https://mcforge.readthedocs.io/en/latest/models/files/
May 3, 20205 yr Author 1 minute ago, Turtledove said: What is it you're trying to do? Is it going to be an entity, item, or what? You can load jsons, objs, b3ds, or if you've got it set up in a java class, that works well too. https://mcforge.readthedocs.io/en/latest/models/files/ It's for a TileEntityRenderer. I'd like to animate the position of this extra model. Would I use modelLoader.getModelOrMissing() for this purpose? I suppose something I could do is create "nothing" blocks that use the model and then load that using block state; but I'm not sure if that's a good way to go about it. No signature for you!
May 3, 20205 yr Hi This example project might give you some inspiration (see mbe21) https://github.com/TheGreyGhost/MinecraftByExample If you want a block model, the easiest way is like you said to register a block with a model, let Forge load it and stitch the texture etc, then grab it using the code in your question. The block associated with your TileEntity is probably the best spot. If your tileentity block already has another model, you can add a blockstate property purely for the purposes of accessing the correct model. Or create an entirely new, unused block. However if you really don't like that idea, you can access the ModelRegistryEvent and ModelLoader.addSpecialModel() instead. -TGG
May 4, 20205 yr Author 20 hours ago, TheGreyGhost said: Hi This example project might give you some inspiration (see mbe21) https://github.com/TheGreyGhost/MinecraftByExample If you want a block model, the easiest way is like you said to register a block with a model, let Forge load it and stitch the texture etc, then grab it using the code in your question. The block associated with your TileEntity is probably the best spot. If your tileentity block already has another model, you can add a blockstate property purely for the purposes of accessing the correct model. Or create an entirely new, unused block. However if you really don't like that idea, you can access the ModelRegistryEvent and ModelLoader.addSpecialModel() instead. -TGG Thanks for that. I ended up just registering a block for it and loading the model like normal. No signature for you!
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.