Jump to content

[1.8] How to have a custom chest render correctly in inventory?


Geforce

Recommended Posts

Hello everyone,

 

I've made a custom chest that extends BlockChest, and the TileEntitySpecialRenderer for it. I used the vanilla "chest.json" for my item texture model, but in-game, it still shows up as a regular chest in my inventory, even though when I place it down, it renders correctly. What should I change in the file to make it show up correctly?

 

My chest's class:

https://github.com/Geforce132/SecurityCraft/blob/master/1.8/src/main/java/org/freeforums/geforce/securitycraft/blocks/BlockKeypadChest.java

 

My TileEntitySpecialRenderer class:

https://github.com/Geforce132/SecurityCraft/blob/master/1.8/src/main/java/org/freeforums/geforce/securitycraft/tileentity/TileEntityKeypadChestRenderer.java

 

Thanks for reading!

~Geforce

Potato's have skin. I have skin. Therefore, i am a potato.

 

Follow me on Twitter!

http://www.twitter.com/I_Mod_Minecraft

Link to comment
Share on other sites

Hi

 

You are extending BlockChest which uses a custom render type hardwired for drawing a normal chest when it's being rendered as an item.  The best way for you is probably to use an ISimpleBlockRenderingHandler, last time I checked (quite a while ago admittedly) there are a few tutorials around.  It has two render methods - one for rendering as an item, and one for the block render when placed (the TileEntitySpecialRenderer is also called in addition to the ISBRH block render method).

 

An IItemRenderer is also possible, just a bit more complicated.  It is used for the "item" views only, not when placed.  Some more info here under the Item Rendering sections

http://greyminecraftcoder.blogspot.com.au/p/list-of-topics.html

 

-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.