Jump to content

Rendering a block like an item.


sejmodder

Recommended Posts

Hello,

 

I am trying to custom render a block, but I just want to render it like an item; it will be one pixel high, and have transparent parts. Let's just take, for example, a sword (laying flat), and say I am trying to render that as my 1px high cube.

 

Since I will be rendering this just like an item, is there any way that I can easily do this using built-in functionality? I would like to be able to just make a single image, and somehow display it as my block, but 1px thick, and not have to make a lot of textures for each item I plan to do this with.

 

I might just be over-thinking this, but I figured this was the place to ask anyways.

 

Thanks in advance for all your help!

 

 

Link to comment
Share on other sites

Hi

 

The code in ItemRenderer.renderItemIn2D takes a part of a texture and renders it so it looks like the vanilla items, i.e. flat but with a small thickness..

 

You just need to provide it with the icon texture coordinates and it does the rest.  Should work for blocks too.

 

-TGG

 

 

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.