Interface ArmorRenderer
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Armor renderers render worn armor items with custom code.
They may be used to render armor with special models or effects.
The renderers are registered with register(ArmorRenderer, ItemConvertible...)
.
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
register
(ArmorRenderer renderer, ItemConvertible... items) Registers the armor renderer for the specified items.void
render
(MatrixStack matrices, VertexConsumerProvider vertexConsumers, ItemStack stack, BipedEntityRenderState bipedEntityRenderState, EquipmentSlot slot, int light, BipedEntityModel<BipedEntityRenderState> contextModel) Renders an armor part.static void
renderPart
(MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, ItemStack stack, Model model, Identifier texture) Helper method for rendering a specific armor model, comes after setting visibility.
-
Method Details
-
register
Registers the armor renderer for the specified items.- Parameters:
renderer
- the rendereritems
- the items- Throws:
IllegalArgumentException
- if an item already has a registered armor rendererNullPointerException
- if either an item or the renderer is null
-
renderPart
static void renderPart(MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, ItemStack stack, Model model, Identifier texture) Helper method for rendering a specific armor model, comes after setting visibility.This primarily handles applying glint and the correct
RenderLayer
- Parameters:
matrices
- the matrix stackvertexConsumers
- the vertex consumer providerlight
- packed lightmap coordinatesstack
- the item stack of the armor itemmodel
- the model to be renderedtexture
- the texture to be applied
-
render
void render(MatrixStack matrices, VertexConsumerProvider vertexConsumers, ItemStack stack, BipedEntityRenderState bipedEntityRenderState, EquipmentSlot slot, int light, BipedEntityModel<BipedEntityRenderState> contextModel) Renders an armor part.- Parameters:
matrices
- the matrix stackvertexConsumers
- the vertex consumer providerstack
- the item stack of the armor itembipedEntityRenderState
- the render state of the entityslot
- the equipment slot in which the armor stack is wornlight
- packed lightmap coordinatescontextModel
- the model provided byFeatureRenderer.getContextModel()
-