Jump to content

ISimpleBlockRenderingHandler.renderInventoryBlock - Render vanilla block?


Recommended Posts

Posted

So I've used ISBRH to render my block. Is it possible to use a vanilla model of the stairs for my block for inventory rendering, or do I have to write the rendering code from scratch?

 

Background: I'm overriding the rendering behavior of stairs to connect glass panes to them. In case it's not obvious, I'm not quite familiar with how minecraft renders inventory items.

Posted

Ok, I figured out how to render it: renderer.renderBlockAsItem(block, metadata, modelId); (of course I'm swapping out modelId so I don't form a recursive loop of doom).

 

Only problem now is that the block renders in completely flat light. Looks like all other blocks have a light source above them. Mine is now entirely bright and looks flat... see screenshot below...

 

nhRCgyX.png

 

Anyone know how to get this shadow effect so it doesn't look like crap?

Posted

Are you making a custom block or overriding vanilla stairs? Because if you're making your stairs, you could just extend BlockStair, I don't see why having a custom renderer for stairs.

I try my best, so apologies if I said something obviously stupid!

Posted

Overriding vanilla stairs. Fixed it by locating the tesselator code in RenderBlock (renderBlockAsItem for anyone looking for this in the future) and just copying into my instance of ISBRH. Note that just calling renderBlockAsItem didn't work.... the light level was too flat.

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.