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

59 lines
2.2 KiB
Java

/*
* Decompiled with CFR 0.152.
*/
package net.minecraft.client.renderer.entity;
import net.minecraft.client.model.WolfModel;
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.WolfArmorLayer;
import net.minecraft.client.renderer.entity.layers.WolfCollarLayer;
import net.minecraft.client.renderer.entity.state.WolfRenderState;
import net.minecraft.resources.Identifier;
import net.minecraft.util.ARGB;
import net.minecraft.world.entity.animal.wolf.Wolf;
public class WolfRenderer
extends AgeableMobRenderer<Wolf, WolfRenderState, WolfModel> {
public WolfRenderer(EntityRendererProvider.Context context) {
super(context, new WolfModel(context.bakeLayer(ModelLayers.WOLF)), new WolfModel(context.bakeLayer(ModelLayers.WOLF_BABY)), 0.5f);
this.addLayer(new WolfArmorLayer(this, context.getModelSet(), context.getEquipmentRenderer()));
this.addLayer(new WolfCollarLayer(this));
}
@Override
protected int getModelTint(WolfRenderState state) {
float wetShade = state.wetShade;
if (wetShade == 1.0f) {
return -1;
}
return ARGB.colorFromFloat(1.0f, wetShade, wetShade, wetShade);
}
@Override
public Identifier getTextureLocation(WolfRenderState state) {
return state.texture;
}
@Override
public WolfRenderState createRenderState() {
return new WolfRenderState();
}
@Override
public void extractRenderState(Wolf entity, WolfRenderState state, float partialTicks) {
super.extractRenderState(entity, state, partialTicks);
state.isAngry = entity.isAngry();
state.isSitting = entity.isInSittingPose();
state.tailAngle = entity.getTailAngle();
state.headRollAngle = entity.getHeadRollAngle(partialTicks);
state.shakeAnim = entity.getShakeAnim(partialTicks);
state.texture = entity.getTexture();
state.wetShade = entity.getWetShade(partialTicks);
state.collarColor = entity.isTame() ? entity.getCollarColor() : null;
state.bodyArmorItem = entity.getBodyArmorItem().copy();
}
}