package net.minecraft.client.renderer.entity;

import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.LivingEntity;
import com.mojang.blaze3d.vertex.PoseStack;
import net.minecraft.client.renderer.entity.layers.RenderLayer;
import net.minecraft.client.renderer.entity.layers.SaddleLayer;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.client.model.StriderModel;
import net.minecraft.world.entity.monster.Strider;

public class StriderRenderer extends MobRenderer<Strider, StriderModel<Strider>> {
    private static final ResourceLocation STRIDER_LOCATION;
    private static final ResourceLocation COLD_LOCATION;
    
    public StriderRenderer(final EntityRenderDispatcher egm) {
        super(egm, new StriderModel(), 0.5f);
        this.addLayer(new SaddleLayer<Strider, StriderModel<Strider>>(this, new StriderModel<Strider>(), new ResourceLocation("textures/entity/strider/strider_saddle.png")));
    }
    
    @Override
    public ResourceLocation getTextureLocation(final Strider bco) {
        return bco.isSuffocating() ? StriderRenderer.COLD_LOCATION : StriderRenderer.STRIDER_LOCATION;
    }
    
    @Override
    protected void scale(final Strider bco, final PoseStack dhl, final float float3) {
        float float4 = 0.9375f;
        if (bco.isBaby()) {
            float4 *= 0.5f;
            this.shadowRadius = 0.25f;
        }
        else {
            this.shadowRadius = 0.5f;
        }
        dhl.scale(float4, float4, float4);
    }
    
    @Override
    protected boolean isShaking(final Strider bco) {
        return bco.isSuffocating();
    }
    
    static {
        STRIDER_LOCATION = new ResourceLocation("textures/entity/strider/strider.png");
        COLD_LOCATION = new ResourceLocation("textures/entity/strider/strider_cold.png");
    }
}
