BakedModel
BakedModel
is the result of calling UnbakedModel#bake
for the vanilla model loader or IUnbakedGeometry#bake
for custom model loaders. Unlike UnbakedModel
or IUnbakedGeometry
, which purely represents a shape without any concept of items or blocks, BakedModel
is not as abstract. It represents geometry that has been optimized and reduced to a form where it is (almost) ready to go to the GPU. It can also process the state of an item or block to change the model.
In a majority of cases, it is not really necessary to implement this interface manually. One can instead use one of the existing implementations.
getOverrides
Returns the ItemOverrides
to use for this model. This is only used if this model is being rendered as an item.
useAmbientOcclusion
If the model is rendered as a block in the level, the block in question does not emit any light, and ambient occlusion is enabled. This causes the model to be rendered with ambient occlusion.
isGui3d
If the model is rendered as an item in an inventory, on the ground as an entity, on an item frame, etc., this makes the model look "flat." In GUIs, this also disables the lighting.
isCustomRenderer
Unless you know what you're doing, just return false
from this and continue on.
When rendering this as an item, returning true
causes the model to not be rendered, instead falling back to BlockEntityWithoutLevelRenderer#renderByItem
. For certain vanilla items such as chests and banners, this method is hardcoded to copy data from the item into a BlockEntity
, before using a BlockEntityRenderer
to render that BE in place of the item. For all other items, it will use the BlockEntityWithoutLevelRenderer
instance provided by IClientItemExtensions#getCustomRenderer
. Refer to BlockEntityWithoutLevelRenderer page for more information.
getParticleIcon
Whatever texture should be used for the particles. For blocks, this shows when an entity falls on it, when it breaks, etc. For items, this shows when it breaks or when it's eaten.
The vanilla method with no parameters has been deprecated in favor of #getParticleIcon(ModelData)
since model data can have an effect on how a particular model might be rendered.
getTransforms
getTransforms
Deprecated in favor of implementing #applyTransform
. The default implementation is fine if #applyTransform
is implemented. See Transform.
applyTransform
See Transform.