Search in sources :

Example 1 with HorseHat

use of party.lemons.biomemakeover.util.extensions.HorseHat in project Biome-Makeover by Lemonszz.

the class HorseHatFeatureRenderer method render.

@Override
public void render(MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, HorseEntity entity, float limbAngle, float limbDistance, float tickDelta, float animationProgress, float headYaw, float headPitch) {
    if (((HorseHat) entity).hasHat()) {
        matrices.scale(1.05F, 1.05F, 1.05F);
        CowboyHatModel<HorseEntity> hatModel = new CowboyHatModel<>();
        ((ModelPart) ((HorseEntityModel) this.getContextModel()).getHeadParts().iterator().next()).rotate(matrices);
        matrices.translate(0F, -0.23F, 0.15);
        matrices.multiply(Vector3f.POSITIVE_X.getDegreesQuaternion(-25F));
        VertexConsumer vertexConsumer = ItemRenderer.getArmorGlintConsumer(vertexConsumers, hatModel.getLayer(this.getTexture(entity)), true, false);
        hatModel.render(matrices, vertexConsumer, light, OverlayTexture.DEFAULT_UV, 1F, 1F, 1F, 1F);
    }
}
Also used : HorseEntity(net.minecraft.entity.passive.HorseEntity) ModelPart(net.minecraft.client.model.ModelPart) HorseHat(party.lemons.biomemakeover.util.extensions.HorseHat) VertexConsumer(net.minecraft.client.render.VertexConsumer)

Aggregations

ModelPart (net.minecraft.client.model.ModelPart)1 VertexConsumer (net.minecraft.client.render.VertexConsumer)1 HorseEntity (net.minecraft.entity.passive.HorseEntity)1 HorseHat (party.lemons.biomemakeover.util.extensions.HorseHat)1