43 lines
1.7 KiB
Java
43 lines
1.7 KiB
Java
/*
|
|
* Decompiled with CFR 0.152.
|
|
*/
|
|
package net.minecraft.client.renderer.entity;
|
|
|
|
import net.minecraft.client.model.DolphinModel;
|
|
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.layers.DolphinCarryingItemLayer;
|
|
import net.minecraft.client.renderer.entity.state.DolphinRenderState;
|
|
import net.minecraft.client.renderer.entity.state.HoldingEntityRenderState;
|
|
import net.minecraft.resources.Identifier;
|
|
import net.minecraft.world.entity.animal.Dolphin;
|
|
|
|
public class DolphinRenderer
|
|
extends AgeableMobRenderer<Dolphin, DolphinRenderState, DolphinModel> {
|
|
private static final Identifier DOLPHIN_LOCATION = Identifier.withDefaultNamespace("textures/entity/dolphin.png");
|
|
|
|
public DolphinRenderer(EntityRendererProvider.Context context) {
|
|
super(context, new DolphinModel(context.bakeLayer(ModelLayers.DOLPHIN)), new DolphinModel(context.bakeLayer(ModelLayers.DOLPHIN_BABY)), 0.7f);
|
|
this.addLayer(new DolphinCarryingItemLayer(this));
|
|
}
|
|
|
|
@Override
|
|
public Identifier getTextureLocation(DolphinRenderState state) {
|
|
return DOLPHIN_LOCATION;
|
|
}
|
|
|
|
@Override
|
|
public DolphinRenderState createRenderState() {
|
|
return new DolphinRenderState();
|
|
}
|
|
|
|
@Override
|
|
public void extractRenderState(Dolphin entity, DolphinRenderState state, float partialTicks) {
|
|
super.extractRenderState(entity, state, partialTicks);
|
|
HoldingEntityRenderState.extractHoldingEntityRenderState(entity, state, this.itemModelResolver);
|
|
state.isMoving = entity.getDeltaMovement().horizontalDistanceSqr() > 1.0E-7;
|
|
}
|
|
}
|
|
|