Although I said I wasn't going to provide any code snippets or sample code, the Item rendering turned out to be so full of "special cases" I've changed my mind.
I have posted the test code I used onto GitHub. It is located
here.
The picture below shows the module structure, based around
- ItemSmileyFace, which is a very simple Item that uses iconRegister.registerIcon() and nothing more.
- BlockNumberedFaces1, a simple cube. When placed in the world as a block it uses vanilla code, when visible as an item it uses IItemRenderer to do custom rendering as a 3D cube.
- ItemNumberedFaces2, the same cube as BlockNumberedFaces1 except it is an Item only, and it is rendered in 2D, the same as most vanilla items.
- ItemNumberedFaces3, the same cube as BlockNumberedFaces1, except it is an Item only. Rendered in 3D using IItemRenderer.
- BlockPyramid, (Block and Item) - showing how to render custom shapes using ISimpleBlockRenderingHandler.
- ItemLampshade, an Item showing some unusual custom rendering using IItemRenderer.
Which one should you use?
- If you want your item to look similar to the vanilla minecraft items, use ItemSmileyFace
- If your item can also be placed in the world as a block, and you want the item to look similar to the block, use BlockPyramid or BlockNumberedFaces1.
- If you want your item to render in 2D similar to the vanilla minecraft items, perhaps with a bit of extra fancy stuff, look at ItemNumberedFaces2
- If your item should render as a 3D object, look at ItemNumberedFaces3 or ItemLampshade.
|
"Inventory" render of the test Items: from left to right: Pyramid, Lampshade, SmileyFace, NumberedFaces1, NumberedFaces2, NumberedFaces3 |
|
"Dropped" render of the test items. ("Fancy Graphics" option on). |
|
"Dropped" render of the test items in picture frames. |
|
"Dropped" render of the two test Items which are also Blocks. |
|
"First Person Equipped" render of the test items. |
|
"Third person equipped" render of the test items. |