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

43 lines
1.8 KiB
Java

/*
* Decompiled with CFR 0.152.
*/
package net.minecraft.client.model;
import java.util.Set;
import net.minecraft.client.model.BabyModelTransform;
import net.minecraft.client.model.QuadrupedModel;
import net.minecraft.client.model.geom.ModelPart;
import net.minecraft.client.model.geom.PartPose;
import net.minecraft.client.model.geom.builders.CubeDeformation;
import net.minecraft.client.model.geom.builders.CubeListBuilder;
import net.minecraft.client.model.geom.builders.LayerDefinition;
import net.minecraft.client.model.geom.builders.MeshDefinition;
import net.minecraft.client.model.geom.builders.MeshTransformer;
import net.minecraft.client.model.geom.builders.PartDefinition;
import net.minecraft.client.renderer.entity.state.SheepRenderState;
public class SheepModel
extends QuadrupedModel<SheepRenderState> {
public static final MeshTransformer BABY_TRANSFORMER = new BabyModelTransform(false, 8.0f, 4.0f, 2.0f, 2.0f, 24.0f, Set.of("head"));
public SheepModel(ModelPart root) {
super(root);
}
public static LayerDefinition createBodyLayer() {
MeshDefinition mesh = QuadrupedModel.createBodyMesh(12, false, true, CubeDeformation.NONE);
PartDefinition root = mesh.getRoot();
root.addOrReplaceChild("head", CubeListBuilder.create().texOffs(0, 0).addBox(-3.0f, -4.0f, -6.0f, 6.0f, 6.0f, 8.0f), PartPose.offset(0.0f, 6.0f, -8.0f));
root.addOrReplaceChild("body", CubeListBuilder.create().texOffs(28, 8).addBox(-4.0f, -10.0f, -7.0f, 8.0f, 16.0f, 6.0f), PartPose.offsetAndRotation(0.0f, 5.0f, 2.0f, 1.5707964f, 0.0f, 0.0f));
return LayerDefinition.create(mesh, 64, 32);
}
@Override
public void setupAnim(SheepRenderState state) {
super.setupAnim(state);
this.head.y += state.headEatPositionScale * 9.0f * state.ageScale;
this.head.xRot = state.headEatAngleScale;
}
}