Jump to content

Custom Block Rendering


gekku

Recommended Posts

Hi All

 

A question similar to this was posted elsewhere by another member, but I thought it would make more sense to have it here.

 

Can anyone help me out with rendering custom blocks in the most recent Forge release? I am transferring over from ModLoader and I was using the TileEntitySpecialRenderer approach. My guess is that this approach is for blocks with special animations (like the MobSpawner)?

 

I am interested in both approaches (the other one uses renderID). I am interested in the other approach to make custom block renderers without a tileEntity.

 

Even if someone just posts their censored code I should be able to go from there.

 

Thanks

Link to comment
Share on other sites

A new block with a custom shape.

 

I have managed to get one rendered not using the TileEntitySpecialRenderer approach, but I am having trouble with the textures. Is there a way to use a different texture for each shape within a block? And can I use my own texture sizes (not using a sprite sheet)?

 

I am just a bit lost as I am use to creating my own model extending BaseModel and renderer extending TileEntitySpecialRenderer which allowed texture offsetting, using textures with different sizes, and binding different textures.

 

The approach I am trying to learn is creating a Renderer implementing the ISimpleBlockRenderingHandler interface. I have managed to get as far as rendering a block with multiple shapes. From here I would like to add a different texture for each shape or use an offset to reference a place within a texture to use for each shape.

Link to comment
Share on other sites

I think I may have worked it out. For every shape within the block you can use a different textureIndex using a sprite sheet. Then you can arrange the different textures for each side in the getBlockTextureFromSide method. It's a bit fiddly, but I think I may manage. I will try and make something and I may add a tutorial for others who are lost.

 

I have always skinned my blocks, so I have never tried it this way.

Link to comment
Share on other sites

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.