package com.acethewildfire.acesbs.entity.client;

import com.acethewildfire.acesbs.AcesBS;
import com.acethewildfire.acesbs.entity.custom.FrenEntity;
import net.minecraft.client.render.VertexConsumerProvider;
import net.minecraft.client.render.entity.EntityRendererFactory;
import net.minecraft.client.render.entity.MobEntityRenderer;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.util.Identifier;

public class FrenRenderer extends MobEntityRenderer<FrenEntity, FrenModel<FrenEntity>> {
    public FrenRenderer(EntityRendererFactory.Context context) {
        super(context, new FrenModel<>(context.getPart(FrenModel.FREN)), 0.75f);
    }

    @Override
    public Identifier getTexture(FrenEntity entity) {
        return Identifier.of(AcesBS.MOD_ID, "textures/entity/fren/fren.png");
    }

    @Override
    public void render(FrenEntity livingEntity, float f, float g, MatrixStack matrixStack,
                       VertexConsumerProvider vertexConsumerProvider, int i) {
        if(livingEntity.isBaby()) {
            matrixStack.scale(0.5f, 0.5f, 0.5f);
        } else {
            matrixStack.scale(1f, 1f, 1f);
        }

        super.render(livingEntity, f, g, matrixStack, vertexConsumerProvider, i);
    }
}