Jump to content

[Unsolved] Crash from IItemRenderer for my custom model[1.6]


Recommended Posts

Posted

Ok,i have another problem for you. I have made a custom model for my block, and it renders ingame, but when adding the IItemRenderer class, it crashes. Here's the crash report:

  Reveal hidden contents

I don't know how to fix it, everything seems fine to me.

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

Hi

 

Your TileEntitySpecialRenderer is throwing an exception for some reason.

 

I suggest adding a breakpoint in your renderTileEntityAt, or alternatively at the try statement in

 

TileEntityRenderer.
    public void renderTileEntityAt(TileEntity par1TileEntity, double par2, double par4, double par6, float par8)
    {
        TileEntitySpecialRenderer tileentityspecialrenderer = this.getSpecialRendererForEntity(par1TileEntity);

        if (tileentityspecialrenderer != null)
        {
            try
            {
                tileentityspecialrenderer.renderTileEntityAt(par1TileEntity, par2, par4, par6, par8);
            }
            catch (Throwable throwable)
            {
                CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Rendering Tile Entity");
                CrashReportCategory crashreportcategory = crashreport.makeCategory("Tile Entity Details");
                par1TileEntity.func_85027_a(crashreportcategory);
                throw new ReportedException(crashreport);
            }
        }
    }

 

Step through it until you see it throw, with any luck the cause will be obvious.

 

-TGG

Posted

renderTileEntityAt tries to load a TileEntity that doesn't exist.

The TileEntity doesn't exist normally outside of the world (in the inventory).

You can't use it directly for the IItemRenderer.

Posted
  On 11/4/2013 at 5:05 PM, GotoLink said:

renderTileEntityAt tries to load a TileEntity that doesn't exist.

The TileEntity doesn't exist normally outside of the world (in the inventory).

You can't use it directly for the IItemRenderer.

And how would i be able to solve this? This is the first time i'm doing custom item renderers.

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

What code in my TileEntity? There's no code in my TileEntity, it's just empty, only a empty constructor.

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

I have followed a tutorial and used the EXACT same code, except for the TileEntity name. I guess i will need to copy the TileEntitySpecialRenderer class...

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

Here's what I found inside Mystcraft and used it, works well:

 

Client proxy:

        TileEntitySpecialRenderer render = new PedestalRenderer();
	ClientRegistry.bindTileEntitySpecialRenderer(TileEntityDisplayPedestal.class, render); //TESR as normal
        MinecraftForgeClient.registerItemRenderer(BlockPedestal.instance.blockID, new ItemRenderPedestal(render, new TileEntityDisplayPedestal()));

 

IItemRenderer:

public class ItemRenderPedestal implements IItemRenderer {
TileEntitySpecialRenderer render;
private TileEntity dummytile;
  
public ItemRenderPedestal(TileEntitySpecialRenderer render, TileEntity dummy) {
    this.render = render;
    this.dummytile = dummy;
}

@Override
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
	return true;
}

@Override
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
	return true;
}

@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
	if (type == IItemRenderer.ItemRenderType.ENTITY)
		GL11.glTranslatef(-0.5F, 0.0F, -0.5F);
	this.render.renderTileEntityAt(this.dummytile, 0.0D, 0.0D, 0.0D, 0.0F);
}
}

 

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

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.

×
×
  • Create New...

Important Information

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