Search in sources :

Example 1 with HatItem

use of party.lemons.biomemakeover.item.HatItem in project Biome-Makeover by Lemonszz.

the class HatFeatureRenderer method render.

@Override
public void render(MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, T entity, float limbAngle, float limbDistance, float tickDelta, float animationProgress, float headYaw, float headPitch) {
    ItemStack headSlot = entity.getEquippedStack(EquipmentSlot.HEAD);
    if (!headSlot.isEmpty() && headSlot.getItem() instanceof HatItem) {
        matrices.push();
        matrices.scale(1.2F, 1.2F, 1.2F);
        EntityModel hatModel = MODELS.get(headSlot.getItem());
        ((ModelWithHead) this.getContextModel()).getHead().rotate(matrices);
        VertexConsumer vertexConsumer = ItemRenderer.getArmorGlintConsumer(vertexConsumers, hatModel.getLayer(this.getTexture(entity)), true, false);
        hatModel.render(matrices, vertexConsumer, light, OverlayTexture.DEFAULT_UV, 1F, 1F, 1F, 1F);
        matrices.pop();
    }
}
Also used : HatItem(party.lemons.biomemakeover.item.HatItem) EntityModel(net.minecraft.client.render.entity.model.EntityModel) VertexConsumer(net.minecraft.client.render.VertexConsumer) ItemStack(net.minecraft.item.ItemStack)

Aggregations

VertexConsumer (net.minecraft.client.render.VertexConsumer)1 EntityModel (net.minecraft.client.render.entity.model.EntityModel)1 ItemStack (net.minecraft.item.ItemStack)1 HatItem (party.lemons.biomemakeover.item.HatItem)1