Views
Actions
Difference between revisions of "ItemStack TileEntityRenderer/1.16"
(Copy BlockEntityWithoutLevelRenderer to MC1.16 archive) |
(Copy BlockEntityWithoutLevelRenderer to MC1.16 archive) |
||
Line 13: | Line 13: | ||
− | [[Category:Items/1.16]] | + | [[Category:Items/1.16|Category:Items]] |
Latest revision as of 04:14, 27 July 2021
ItemStackTileEntityRenderer
is a class that allows custom usages of MatrixStack
s and IRenderTypeBuffer
s to render items.
Using ItemStackTileEntityRenderer
ItemStackTileEntityRenderer
allows you to render your item by extending the class and overriding ItemStackTileEntityRenderer#func_239207_a_
.
In order to use a ISTER, the Item must first return true for IBakedModel#isBuiltInRenderer
. It is also recommended that if you are using a block that AbstractBlock#getRenderType
returns BlockRenderType#ENTITYBLOCK_ANIMATED
so that it will render correctly in layers and minecarts. Once that returns true, the Item’s ISTER will be accessed for rendering. If it does not have one, it will use the default ItemStackTileEntityRenderer#instance
.
To set the ISTER for an Item, use Item.Properties#setISTER
. Each Item can only ever provide one ISTER, and the getter is final so that mods do not return new instances each frame.
That’s it, no additional setup is necessary to use a ISTER.
If you need to access the TransformType
for rendering, you can store the one passed through IBakedModel#handlePerspective
and use it during rendering. This method will always be called before ItemStackTileEntityRenderer#func_239207_a_
.