package jesse.keeblarcraft.entity;

import jesse.keeblarcraft.Keeblarcraft;
import jesse.keeblarcraft.entity.model.PorcupineModel;
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 PorcupineRenderer extends MobEntityRenderer<PorcupineEntity, PorcupineModel<PorcupineEntity>> {
    // private static final Identifier TEXTURE = 
    // new Identifier(Keeblarcraft.MOD_ID + "src/main/resources/assets/keeblarcraft/textures/entity/porcupine.png");

    public PorcupineRenderer(EntityRendererFactory.Context context) {
      super(context, new PorcupineModel<>(context.getPart(ModModelsLayers.PORCUPINE)), (float) .6); //.6 is the shadows size of entity
   }

    @Override
    public Identifier getTexture(PorcupineEntity entity) {
        return new Identifier(Keeblarcraft.MOD_ID, "textures/entity/porcupine.png");
    }

    @Override
    public void render(PorcupineEntity mobEntity, float f, float g, MatrixStack matrixStack, VertexConsumerProvider vertexConsumerProvider, int i) {
     if (mobEntity.isBaby()) {
        matrixStack.scale((float).5,(float) .5,(float) 1);
     } else {
        matrixStack.scale((float)2,(float) 2,(float) 2);
     }
     super.render(mobEntity, f, g, matrixStack, vertexConsumerProvider, i);
   }
}

