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, net.minecraft.item.ItemConvertible... items) Registers the armor renderer for the specified items.void
render
(net.minecraft.client.util.math.MatrixStack matrices, net.minecraft.client.render.VertexConsumerProvider vertexConsumers, net.minecraft.item.ItemStack stack, net.minecraft.entity.LivingEntity entity, net.minecraft.entity.EquipmentSlot slot, int light, net.minecraft.client.render.entity.model.BipedEntityModel<net.minecraft.entity.LivingEntity> contextModel) Renders an armor part.static void
renderPart
(net.minecraft.client.util.math.MatrixStack matrices, net.minecraft.client.render.VertexConsumerProvider vertexConsumers, int light, net.minecraft.item.ItemStack stack, net.minecraft.client.model.Model model, net.minecraft.util.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(net.minecraft.client.util.math.MatrixStack matrices, net.minecraft.client.render.VertexConsumerProvider vertexConsumers, int light, net.minecraft.item.ItemStack stack, net.minecraft.client.model.Model model, net.minecraft.util.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(net.minecraft.client.util.math.MatrixStack matrices, net.minecraft.client.render.VertexConsumerProvider vertexConsumers, net.minecraft.item.ItemStack stack, net.minecraft.entity.LivingEntity entity, net.minecraft.entity.EquipmentSlot slot, int light, net.minecraft.client.render.entity.model.BipedEntityModel<net.minecraft.entity.LivingEntity> contextModel) Renders an armor part.- Parameters:
matrices
- the matrix stackvertexConsumers
- the vertex consumer providerstack
- the item stack of the armor itementity
- the entity wearing the armor itemslot
- the equipment slot in which the armor stack is wornlight
- packed lightmap coordinatescontextModel
- the model provided byFeatureRenderer.getContextModel()
-