Jump to content

Recommended Posts

Posted

I have custom render code, and I know for a fact that my model, renderer, tile entity, and block are fine. But it's just rendering an invisible block (because we said not to render any sides in the block class) and I think the problem is that I'm not binding my renderer to my tile entity properly. In my client proxy I have a method called registerRenderers and in it I have my render binding. I have my client proxy set in my @NetworkMod but how to I make the game look at the registerRenderers method? Would I put it in my Init PreInit or PostInit or where?

Posted

Call it from the @Init method. And as a side note, my magical-code-viewing-device ( MCVD ) is broken, so I can't pull up your code... Sorry.

I am Mew. The Legendary Psychic. I behave oddly and am always playing practical jokes.

 

I have also found that I really love making extremely long and extremely but sometimes not so descriptive variables. Sort of like what I just did there xD

Posted

Sorry, code

 

Main class

 

  Reveal hidden contents

 

 

ClientProxy

 

  Reveal hidden contents

 

Posted

Let's see...you have a field called proxy which should be populated by @SidedProxy with your CommonProxy on server side and ClientProxy on client side.

The answer is:

proxy.registerRenderers();

Posted

I know this, and I have tried it. That is why I have the proxy field. But am I defining what my proxy field is incorrectly? You said to make it as my @SidedProxy, by that do you mean have two fields EX: proxy; and proxyC;? Or do I do something else?

Posted

public class CommonProxy {

        // Client stuff
        public void registerRenderers() {
                
         ClientRegistry.bindTileEntitySpecialRenderer(com.jmanpenilla.carbonmod.tileentity.TileGrill.class, new RenderGrill());
        
        }
}

Doesn't make sense.

Posted

Hi

 

Just a thought -have you overridden Block.createNewTileEntity() properly?  are you sure you are creating the tile entity at the proper location?

 

It might help to diagnose your problem if you set a breakpoint in RenderGlobal.renderEntities below.  (Suggest spawning in flatland with just your block in sight)

 

If your TileEntity has been correctly created, it should be in tileEntities.

 

            for (i = 0; i < this.tileEntities.size(); ++i)
            {
                TileEntity tile = (TileEntity)tileEntities.get(i);
                if (tile.shouldRenderInPass(pass) && par2ICamera.isBoundingBoxInFrustum(tile.getRenderBoundingBox()))
                {
                    TileEntityRenderer.instance.renderTileEntity(tile, par3);
                }
            }

 

If it gets through to TileEntitySpecialRenderer.getSpecialRendererForClass then it should find your renderer in specialRendererMap.  If it doesn't (recurses up to TileEntity) then you haven't registered your renderer properly (ClientRegistry.bindTileEntitySpecialRenderer)

 

        TileEntitySpecialRenderer tileentityspecialrenderer = (TileEntitySpecialRenderer)this.specialRendererMap.get(par1Class);

        if (tileentityspecialrenderer == null && par1Class != TileEntity.class)

 

If it retrieves your renderer properly and calls renderTileEntityAt, but it still doesn't render properly, then the problem is in your rendering code.

 

-TGG

 

 

 

Posted
  On 9/17/2013 at 12:17 PM, GotoLink said:

public class CommonProxy {

        // Client stuff
        public void registerRenderers() {
                
         ClientRegistry.bindTileEntitySpecialRenderer(com.jmanpenilla.carbonmod.tileentity.TileGrill.class, new RenderGrill());
        
        }
}

Doesn't make sense.

 

Was not used. Just for a test to see if I could call it from there.

Posted

YAY! Solved. Also, while a pro is here would you happen to know why my worlds in eclipse never save?

log:

 

  Reveal hidden contents

 

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.