/* * 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.TropicalFishRenderState; import net.minecraft.util.Mth; public class TropicalFishModelA extends EntityModel { private final ModelPart tail; public TropicalFishModelA(ModelPart root) { super(root); this.tail = root.getChild("tail"); } public static LayerDefinition createBodyLayer(CubeDeformation g) { MeshDefinition mesh = new MeshDefinition(); PartDefinition root = mesh.getRoot(); int yo = 22; root.addOrReplaceChild("body", CubeListBuilder.create().texOffs(0, 0).addBox(-1.0f, -1.5f, -3.0f, 2.0f, 3.0f, 6.0f, g), PartPose.offset(0.0f, 22.0f, 0.0f)); root.addOrReplaceChild("tail", CubeListBuilder.create().texOffs(22, -6).addBox(0.0f, -1.5f, 0.0f, 0.0f, 3.0f, 6.0f, g), PartPose.offset(0.0f, 22.0f, 3.0f)); root.addOrReplaceChild("right_fin", CubeListBuilder.create().texOffs(2, 16).addBox(-2.0f, -1.0f, 0.0f, 2.0f, 2.0f, 0.0f, g), PartPose.offsetAndRotation(-1.0f, 22.5f, 0.0f, 0.0f, 0.7853982f, 0.0f)); root.addOrReplaceChild("left_fin", CubeListBuilder.create().texOffs(2, 12).addBox(0.0f, -1.0f, 0.0f, 2.0f, 2.0f, 0.0f, g), PartPose.offsetAndRotation(1.0f, 22.5f, 0.0f, 0.0f, -0.7853982f, 0.0f)); root.addOrReplaceChild("top_fin", CubeListBuilder.create().texOffs(10, -5).addBox(0.0f, -3.0f, 0.0f, 0.0f, 3.0f, 6.0f, g), PartPose.offset(0.0f, 20.5f, -3.0f)); return LayerDefinition.create(mesh, 32, 32); } @Override public void setupAnim(TropicalFishRenderState state) { super.setupAnim(state); float amplitudeMultiplier = state.isInWater ? 1.0f : 1.5f; this.tail.yRot = -amplitudeMultiplier * 0.45f * Mth.sin(0.6f * state.ageInTicks); } }