2025-11-24 22:52:51 +03:00

50 lines
1.7 KiB
Java

/*
* Decompiled with CFR 0.152.
*/
package net.minecraft.client.renderer.entity;
import net.minecraft.client.model.TurtleModel;
import net.minecraft.client.model.geom.ModelLayers;
import net.minecraft.client.renderer.entity.AgeableMobRenderer;
import net.minecraft.client.renderer.entity.EntityRendererProvider;
import net.minecraft.client.renderer.entity.state.TurtleRenderState;
import net.minecraft.resources.Identifier;
import net.minecraft.world.entity.animal.Turtle;
public class TurtleRenderer
extends AgeableMobRenderer<Turtle, TurtleRenderState, TurtleModel> {
private static final Identifier TURTLE_LOCATION = Identifier.withDefaultNamespace("textures/entity/turtle/big_sea_turtle.png");
public TurtleRenderer(EntityRendererProvider.Context context) {
super(context, new TurtleModel(context.bakeLayer(ModelLayers.TURTLE)), new TurtleModel(context.bakeLayer(ModelLayers.TURTLE_BABY)), 0.7f);
}
@Override
protected float getShadowRadius(TurtleRenderState state) {
float radius = super.getShadowRadius(state);
if (state.isBaby) {
return radius * 0.83f;
}
return radius;
}
@Override
public TurtleRenderState createRenderState() {
return new TurtleRenderState();
}
@Override
public void extractRenderState(Turtle entity, TurtleRenderState state, float partialTicks) {
super.extractRenderState(entity, state, partialTicks);
state.isOnLand = !entity.isInWater() && entity.onGround();
state.isLayingEgg = entity.isLayingEgg();
state.hasEgg = !entity.isBaby() && entity.hasEgg();
}
@Override
public Identifier getTextureLocation(TurtleRenderState state) {
return TURTLE_LOCATION;
}
}