Jump to content

Recommended Posts

Posted

Does anyone know if AdvancedModelLoader will be in Forge 1.8 and is there any interface that I could use to render items and blocks Wavefront models?

Posted

Hi

 

I don't know when Lex plans to add AdvancedModelLoader back in; if you have some experience you could add it yourself, I can't imagine it will be very complicated since it's the same OpenGL renderering as before, just needs adaption to the new Tessellator (WorldRenderer) classes.

 

At the moment I think the only way to custom render blocks and items is to use ASM/Reflection to modify the vanilla rendering classes, for example overriding Block.getRenderType() to return (eg) 4, and then modifying eg BlockRendererDispatcher:

    public boolean renderBlock(IBlockState p_175018_1_, BlockPos p_175018_2_, IBlockAccess p_175018_3_, WorldRenderer p_175018_4_)
    {
        try
        {
            int i = p_175018_1_.getBlock().getRenderType();

            if (i == -1)
            {
                return false;
            }
            else
            {
                switch (i)
                {
                    case 1:
                        return this.fluidRenderer.renderFluid(p_175018_3_, p_175018_1_, p_175018_2_, p_175018_4_);
                    case 2:
                        return false;
                    case 3:
                        IBakedModel ibakedmodel = this.getModelFromBlockState(p_175018_1_, p_175018_3_, p_175018_2_);
                        return this.blockModelRenderer.renderModel(p_175018_3_, ibakedmodel, p_175018_1_, p_175018_2_, p_175018_4_);

// add case 4: here
                    default:
                        return false;
                }
            }
        }

 

I imagine Forge will be updated to add the equivalent of the old ISBRH and IItemRenderer if enough people ask; don't know when though.  You could ask on the suggestions forum.

 

AFAIK TileEntitySpecialRenderers should still work, you would just need to port the AdvancedModelLoader across :)

 

-TGG

 

 

 

Posted

Ok... so I now have new AdvancedModelLoader and I'm able to render tileentities but still have problem with rendering custom models as items and inventory icons. Does anyone know how it should be done without using ASM or reflections?

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.