Jump to content

Recommended Posts

Posted

So, I'm trying to make a custom explosive block, and the problem is that the primed explosive entity is invisible. It is there, and it explodes, but it's invisible. Here are the relevant parts of the code :

 

The class for the entity

 

  Reveal hidden contents

 

 

Then renderer class associated with it :

 

  Reveal hidden contents

 

 

The registering of the renderer in the ClientProxy :

 

  Reveal hidden contents

 

 

The entity registering in the main file :

 

  Reveal hidden contents

 

 

I've tried to add some debug lines, and it seems that the doRender() method of the renderer is never called, in fact the constructor of the renderer class never seems to be called; if that can help.

signat10.png
Posted

Are you sure it's never called?

 

if this is called RenderingRegistry.registerEntityRenderingHandler(RozNukePrimed.class, new RenderRozNukePrimed()); then the constructor for RenderRozNukePrimed is called, even if the registerEntityRenderingHandler fails the method parameters are executed before.

 

Put a debug line on the "RenderingRegistry.registerEntityRenderingHandler(RozNukePrimed.class, new RenderRozNukePrimed());" line and check if that line is getting executed, because I have a feeling it's not.

I require Java, both the coffee and the code :)

Posted
  On 1/30/2015 at 3:19 PM, Belpois said:

Are you sure it's never called?

 

if this is called RenderingRegistry.registerEntityRenderingHandler(RozNukePrimed.class, new RenderRozNukePrimed()); then the constructor for RenderRozNukePrimed is called, even if the registerEntityRenderingHandler fails the method parameters are executed before.

 

Put a debug line on the "RenderingRegistry.registerEntityRenderingHandler(RozNukePrimed.class, new RenderRozNukePrimed());" line and check if that line is getting executed, because I have a feeling it's not.

That's what I first though, but if I put a debug line in the function that executes that line it says it is, which is why I'm stumped by the fact that if I put the line in the constructor it doesn't show up.

signat10.png
Posted

RenderingRegistry.registerEntityRenderingHandler(RozNukePrimed.class, new RenderRozNukePrimed())

Where do you call that method?

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Posted
  On 1/30/2015 at 4:18 PM, larsgerrits said:

RenderingRegistry.registerEntityRenderingHandler(RozNukePrimed.class, new RenderRozNukePrimed())

Where do you call that method?

In the ClientProxy class. Here is the complete code for the Client Proxy class :

 

  Reveal hidden contents

 

 

The proxy method is called in the main mod preInit method like this :

proxy.registerRenderers();

 

For more details on the code, here is the link to the code's GitHub

signat10.png
Posted

This is one of my custom renderers from a mod I'm working on, this is all executed on preInit

 

@Override
public void registerCustomBlockRenderers()
{
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityPaintableBlockEntity.class, new TileEntityPaintableBlockRenderer());
GameRegistry.registerTileEntity(TileEntityPaintableBlockEntity.class, "tileEntityPaintableBlock");

Reference.PAINTER_BLOCK_RENDERING_HANDLER_ID = RenderingRegistry.getNextAvailableRenderId();
RenderingRegistry.registerBlockHandler(new PainterBlockRenderingHandler(Reference.PAINTER_BLOCK_RENDERING_HANDLER_ID));
}

 

Try and replace your code with mine, see how it works... I think you need to bind the entity with the bindTileEntitySpecialRenderer

I require Java, both the coffee and the code :)

Posted
  On 1/30/2015 at 5:35 PM, Belpois said:

This is one of my custom renderers from a mod I'm working on, this is all executed on preInit

 

@Override
public void registerCustomBlockRenderers()
{
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityPaintableBlockEntity.class, new TileEntityPaintableBlockRenderer());
GameRegistry.registerTileEntity(TileEntityPaintableBlockEntity.class, "tileEntityPaintableBlock");

Reference.PAINTER_BLOCK_RENDERING_HANDLER_ID = RenderingRegistry.getNextAvailableRenderId();
RenderingRegistry.registerBlockHandler(new PainterBlockRenderingHandler(Reference.PAINTER_BLOCK_RENDERING_HANDLER_ID));
}

 

Try and replace your code with mine, see how it works... I think you need to bind the entity with the bindTileEntitySpecialRenderer

That is for blocks, but he has problems with entities...

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Posted

Aaaa crud forgot primed tnt's are entities, I might try to get the repo and run it on my pc when I get home, been through the code on git hub and it seems fine...

I require Java, both the coffee and the code :)

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.