/* * Decompiled with CFR 0.152. */ package net.minecraft.client.model; import net.minecraft.client.model.EntityModel; 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.PartDefinition; import net.minecraft.client.renderer.entity.state.EntityRenderState; import net.minecraft.client.renderer.rendertype.RenderTypes; public class WindChargeModel extends EntityModel { private static final int ROTATION_SPEED = 16; private final ModelPart bone; private final ModelPart windCharge; private final ModelPart wind; public WindChargeModel(ModelPart root) { super(root, RenderTypes::entityTranslucent); this.bone = root.getChild("bone"); this.wind = this.bone.getChild("wind"); this.windCharge = this.bone.getChild("wind_charge"); } public static LayerDefinition createBodyLayer() { MeshDefinition meshdefinition = new MeshDefinition(); PartDefinition partdefinition = meshdefinition.getRoot(); PartDefinition bone = partdefinition.addOrReplaceChild("bone", CubeListBuilder.create(), PartPose.offset(0.0f, 0.0f, 0.0f)); bone.addOrReplaceChild("wind", CubeListBuilder.create().texOffs(15, 20).addBox(-4.0f, -1.0f, -4.0f, 8.0f, 2.0f, 8.0f, new CubeDeformation(0.0f)).texOffs(0, 9).addBox(-3.0f, -2.0f, -3.0f, 6.0f, 4.0f, 6.0f, new CubeDeformation(0.0f)), PartPose.offsetAndRotation(0.0f, 0.0f, 0.0f, 0.0f, -0.7854f, 0.0f)); bone.addOrReplaceChild("wind_charge", CubeListBuilder.create().texOffs(0, 0).addBox(-2.0f, -2.0f, -2.0f, 4.0f, 4.0f, 4.0f, new CubeDeformation(0.0f)), PartPose.offset(0.0f, 0.0f, 0.0f)); return LayerDefinition.create(meshdefinition, 64, 32); } @Override public void setupAnim(EntityRenderState state) { super.setupAnim(state); this.windCharge.yRot = -state.ageInTicks * 16.0f * ((float)Math.PI / 180); this.wind.yRot = state.ageInTicks * 16.0f * ((float)Math.PI / 180); } }