DARKHAWX Posted May 3, 2020 Share Posted May 3, 2020 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? Quote No signature for you! Link to comment Share on other sites More sharing options...
Turtledove Posted May 3, 2020 Share Posted May 3, 2020 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/ Quote Link to comment Share on other sites More sharing options...
DARKHAWX Posted May 3, 2020 Author Share Posted May 3, 2020 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. Quote No signature for you! Link to comment Share on other sites More sharing options...
TheGreyGhost Posted May 3, 2020 Share Posted May 3, 2020 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 Quote Link to comment Share on other sites More sharing options...
DARKHAWX Posted May 4, 2020 Author Share Posted May 4, 2020 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. Quote No signature for you! Link to comment Share on other sites More sharing options...
Recommended Posts
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.