47 lines
1.9 KiB
Java
47 lines
1.9 KiB
Java
/*
|
|
* Decompiled with CFR 0.152.
|
|
*/
|
|
package net.minecraft.client.renderer.entity;
|
|
|
|
import net.minecraft.client.model.SheepModel;
|
|
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.SheepWoolLayer;
|
|
import net.minecraft.client.renderer.entity.layers.SheepWoolUndercoatLayer;
|
|
import net.minecraft.client.renderer.entity.state.SheepRenderState;
|
|
import net.minecraft.resources.Identifier;
|
|
import net.minecraft.world.entity.animal.sheep.Sheep;
|
|
|
|
public class SheepRenderer
|
|
extends AgeableMobRenderer<Sheep, SheepRenderState, SheepModel> {
|
|
private static final Identifier SHEEP_LOCATION = Identifier.withDefaultNamespace("textures/entity/sheep/sheep.png");
|
|
|
|
public SheepRenderer(EntityRendererProvider.Context context) {
|
|
super(context, new SheepModel(context.bakeLayer(ModelLayers.SHEEP)), new SheepModel(context.bakeLayer(ModelLayers.SHEEP_BABY)), 0.7f);
|
|
this.addLayer(new SheepWoolUndercoatLayer(this, context.getModelSet()));
|
|
this.addLayer(new SheepWoolLayer(this, context.getModelSet()));
|
|
}
|
|
|
|
@Override
|
|
public Identifier getTextureLocation(SheepRenderState state) {
|
|
return SHEEP_LOCATION;
|
|
}
|
|
|
|
@Override
|
|
public SheepRenderState createRenderState() {
|
|
return new SheepRenderState();
|
|
}
|
|
|
|
@Override
|
|
public void extractRenderState(Sheep entity, SheepRenderState state, float partialTicks) {
|
|
super.extractRenderState(entity, state, partialTicks);
|
|
state.headEatAngleScale = entity.getHeadEatAngleScale(partialTicks);
|
|
state.headEatPositionScale = entity.getHeadEatPositionScale(partialTicks);
|
|
state.isSheared = entity.isSheared();
|
|
state.woolColor = entity.getColor();
|
|
state.isJebSheep = SheepRenderer.checkMagicName(entity, "jeb_");
|
|
}
|
|
}
|
|
|