package com.dairymoose.entity;

import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer;
import net.minecraft.client.model.EntityModel;
import net.minecraft.client.model.geom.ModelLayerLocation;
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.resources.ResourceLocation;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;

@OnlyIn(Dist.CLIENT)
/* loaded from: outputsrg.jar:com/dairymoose/entity/BicycleModel.class */
public class BicycleModel extends EntityModel<BicycleEntity> {
    public static final ModelLayerLocation BICYCLE = new ModelLayerLocation(new ResourceLocation("modernlife", "bicycle"), "main");
    private final ModelPart crankset;
    private final ModelPart front_wheel;
    private final ModelPart back_wheel;
    private final ModelPart back_wheel_sprite;
    private final ModelPart front_wheel_sprite;
    private final ModelPart frame;
    private final ModelPart crank_arm;

    public BicycleModel(ModelPart root) {
        this.crankset = root.getChild("crankset");
        this.front_wheel = root.getChild("front_wheel");
        this.back_wheel = root.getChild("back_wheel");
        this.back_wheel_sprite = root.getChild("back_wheel_sprite");
        this.front_wheel_sprite = root.getChild("front_wheel_sprite");
        this.frame = root.getChild("frame");
        this.crank_arm = root.getChild("crank_arm");
    }

    public static LayerDefinition createBodyLayer() {
        MeshDefinition meshdefinition = new MeshDefinition();
        PartDefinition partdefinition = meshdefinition.getRoot();
        PartDefinition crankset = partdefinition.addOrReplaceChild("crankset", CubeListBuilder.create().texOffs(15, 1).addBox(-0.55f, -0.7272f, -1.8f, 0.0f, 1.0f, 1.0f, new CubeDeformation(0.0f)).texOffs(15, 1).addBox(-0.55f, -0.7272f, 1.2f, 0.0f, 1.0f, 1.0f, new CubeDeformation(0.0f)).texOffs(15, 1).addBox(-0.55f, 0.875f, -0.1978f, 0.0f, 1.0f, 1.0f, new CubeDeformation(0.0f)).texOffs(15, 1).addBox(-0.55f, -2.125f, -0.1978f, 0.0f, 1.0f, 1.0f, new CubeDeformation(0.0f)), PartPose.offset(-1.025f, 20.0f, 2.0f));
        crankset.addOrReplaceChild("hexadecagon_r1", CubeListBuilder.create().texOffs(15, 1).addBox(0.5f, -2.0f, -0.3978f, 0.0f, 1.0f, 1.0f, new CubeDeformation(0.0f)).texOffs(15, 1).addBox(0.5f, 1.0f, -0.3978f, 0.0f, 1.0f, 1.0f, new CubeDeformation(0.0f)).texOffs(15, 1).addBox(0.5f, -0.6022f, 1.0f, 0.0f, 1.0f, 1.0f, new CubeDeformation(0.0f)).texOffs(15, 1).addBox(0.5f, -0.6022f, -2.0f, 0.0f, 1.0f, 1.0f, new CubeDeformation(0.0f)), PartPose.offsetAndRotation(-1.05f, -0.125f, 0.2f, -0.3927f, 0.0f, 0.0f));
        crankset.addOrReplaceChild("hexadecagon_r2", CubeListBuilder.create().texOffs(15, 1).addBox(0.5f, -2.0f, -0.3978f, 0.0f, 1.0f, 1.0f, new CubeDeformation(0.0f)).texOffs(15, 1).addBox(0.5f, 1.0f, -0.3978f, 0.0f, 1.0f, 1.0f, new CubeDeformation(0.0f)).texOffs(15, 1).addBox(0.5f, -0.6022f, 1.0f, 0.0f, 1.0f, 1.0f, new CubeDeformation(0.0f)).texOffs(15, 1).addBox(0.5f, -0.6022f, -2.0f, 0.0f, 1.0f, 1.0f, new CubeDeformation(0.0f)), PartPose.offsetAndRotation(-1.05f, -0.125f, 0.2f, 0.3927f, 0.0f, 0.0f));
        crankset.addOrReplaceChild("hexadecagon_r3", CubeListBuilder.create().texOffs(15, 1).addBox(0.5f, -0.6022f, 1.0f, 0.0f, 1.0f, 1.0f, new CubeDeformation(0.0f)).texOffs(15, 1).addBox(0.5f, -0.6022f, -2.0f, 0.0f, 1.0f, 1.0f, new CubeDeformation(0.0f)), PartPose.offsetAndRotation(-1.05f, -0.125f, 0.2f, -0.7854f, 0.0f, 0.0f));
        crankset.addOrReplaceChild("hexadecagon_r4", CubeListBuilder.create().texOffs(15, 1).addBox(0.5f, -0.6022f, 1.0f, 0.0f, 1.0f, 1.0f, new CubeDeformation(0.0f)).texOffs(15, 1).addBox(0.5f, -0.6022f, -2.0f, 0.0f, 1.0f, 1.0f, new CubeDeformation(0.0f)), PartPose.offsetAndRotation(-1.05f, -0.125f, 0.2f, 0.7854f, 0.0f, 0.0f));
        PartDefinition front_wheel = partdefinition.addOrReplaceChild("front_wheel", CubeListBuilder.create().texOffs(0, 0).addBox(-0.5f, -0.9955f, -22.05f, 1.0f, 2.0f, 1.0f, new CubeDeformation(0.0f)).texOffs(0, 0).addBox(-0.5f, -0.9955f, -12.95f, 1.0f, 2.0f, 1.0f, new CubeDeformation(0.0f)).texOffs(0, 0).addBox(-0.5f, 4.05f, -18.0045f, 1.0f, 1.0f, 2.0f, new CubeDeformation(0.0f)).texOffs(0, 0).addBox(-0.5f, -5.05f, -18.0045f, 1.0f, 1.0f, 2.0f, new CubeDeformation(0.0f)), PartPose.offset(0.0f, 19.0f, 9.0f));
        front_wheel.addOrReplaceChild("hexadecagon_r5", CubeListBuilder.create().texOffs(0, 0).addBox(-0.5f, -5.05f, -1.0045f, 1.0f, 1.0f, 2.0f, new CubeDeformation(0.0f)).texOffs(0, 0).addBox(-0.5f, 4.05f, -1.0045f, 1.0f, 1.0f, 2.0f, new CubeDeformation(0.0f)).texOffs(0, 0).addBox(-0.5f, -0.9955f, 4.05f, 1.0f, 2.0f, 1.0f, new CubeDeformation(0.0f)).texOffs(0, 0).addBox(-0.5f, -0.9955f, -5.05f, 1.0f, 2.0f, 1.0f, new CubeDeformation(0.0f)), PartPose.offsetAndRotation(0.0f, 0.0f, -17.0f, -0.3927f, 0.0f, 0.0f));
        front_wheel.addOrReplaceChild("hexadecagon_r6", CubeListBuilder.create().texOffs(0, 0).addBox(-0.5f, -5.05f, -1.0045f, 1.0f, 1.0f, 2.0f, new CubeDeformation(0.0f)).texOffs(0, 0).addBox(-0.5f, 4.05f, -1.0045f, 1.0f, 1.0f, 2.0f, new CubeDeformation(0.0f)).texOffs(0, 0).addBox(-0.5f, -0.9955f, 4.05f, 1.0f, 2.0f, 1.0f, new CubeDeformation(0.0f)).texOffs(0, 0).addBox(-0.5f, -0.9955f, -5.05f, 1.0f, 2.0f, 1.0f, new CubeDeformation(0.0f)), PartPose.offsetAndRotation(0.0f, 0.0f, -17.0f, 0.3927f, 0.0f, 0.0f));
        front_wheel.addOrReplaceChild("hexadecagon_r7", CubeListBuilder.create().texOffs(0, 0).addBox(-0.5f, -0.9955f, 4.05f, 1.0f, 2.0f, 1.0f, new CubeDeformation(0.0f)).texOffs(0, 0).addBox(-0.5f, -0.9955f, -5.05f, 1.0f, 2.0f, 1.0f, new CubeDeformation(0.0f)), PartPose.offsetAndRotation(0.0f, 0.0f, -17.0f, -0.7854f, 0.0f, 0.0f));
        front_wheel.addOrReplaceChild("hexadecagon_r8", CubeListBuilder.create().texOffs(0, 0).addBox(-0.5f, -0.9955f, 4.05f, 1.0f, 2.0f, 1.0f, new CubeDeformation(0.0f)).texOffs(0, 0).addBox(-0.5f, -0.9955f, -5.05f, 1.0f, 2.0f, 1.0f, new CubeDeformation(0.0f)), PartPose.offsetAndRotation(0.0f, 0.0f, -17.0f, 0.7854f, 0.0f, 0.0f));
        PartDefinition back_wheel = partdefinition.addOrReplaceChild("back_wheel", CubeListBuilder.create().texOffs(0, 0).addBox(-0.5f, -0.9955f, -5.05f, 1.0f, 2.0f, 1.0f, new CubeDeformation(0.0f)).texOffs(0, 0).addBox(-0.5f, -0.9955f, 4.05f, 1.0f, 2.0f, 1.0f, new CubeDeformation(0.0f)).texOffs(0, 0).addBox(-0.5f, 4.05f, -1.0045f, 1.0f, 1.0f, 2.0f, new CubeDeformation(0.0f)).texOffs(0, 0).addBox(-0.5f, -5.05f, -1.0045f, 1.0f, 1.0f, 2.0f, new CubeDeformation(0.0f)), PartPose.offset(0.0f, 19.0f, 9.0f));
        back_wheel.addOrReplaceChild("hexadecagon_r9", CubeListBuilder.create().texOffs(0, 0).addBox(-0.5f, -5.05f, -1.0045f, 1.0f, 1.0f, 2.0f, new CubeDeformation(0.0f)).texOffs(0, 0).addBox(-0.5f, 4.05f, -1.0045f, 1.0f, 1.0f, 2.0f, new CubeDeformation(0.0f)).texOffs(0, 0).addBox(-0.5f, -0.9955f, 4.05f, 1.0f, 2.0f, 1.0f, new CubeDeformation(0.0f)).texOffs(0, 0).addBox(-0.5f, -0.9955f, -5.05f, 1.0f, 2.0f, 1.0f, new CubeDeformation(0.0f)), PartPose.offsetAndRotation(0.0f, 0.0f, 0.0f, -0.3927f, 0.0f, 0.0f));
        back_wheel.addOrReplaceChild("hexadecagon_r10", CubeListBuilder.create().texOffs(0, 0).addBox(-0.5f, -5.05f, -1.0045f, 1.0f, 1.0f, 2.0f, new CubeDeformation(0.0f)).texOffs(0, 0).addBox(-0.5f, 4.05f, -1.0045f, 1.0f, 1.0f, 2.0f, new CubeDeformation(0.0f)).texOffs(0, 0).addBox(-0.5f, -0.9955f, 4.05f, 1.0f, 2.0f, 1.0f, new CubeDeformation(0.0f)).texOffs(0, 0).addBox(-0.5f, -0.9955f, -5.05f, 1.0f, 2.0f, 1.0f, new CubeDeformation(0.0f)), PartPose.offsetAndRotation(0.0f, 0.0f, 0.0f, 0.3927f, 0.0f, 0.0f));
        back_wheel.addOrReplaceChild("hexadecagon_r11", CubeListBuilder.create().texOffs(0, 0).addBox(-0.5f, -0.9955f, 4.05f, 1.0f, 2.0f, 1.0f, new CubeDeformation(0.0f)).texOffs(0, 0).addBox(-0.5f, -0.9955f, -5.05f, 1.0f, 2.0f, 1.0f, new CubeDeformation(0.0f)), PartPose.offsetAndRotation(0.0f, 0.0f, 0.0f, -0.7854f, 0.0f, 0.0f));
        back_wheel.addOrReplaceChild("hexadecagon_r12", CubeListBuilder.create().texOffs(0, 0).addBox(-0.5f, -0.9955f, 4.05f, 1.0f, 2.0f, 1.0f, new CubeDeformation(0.0f)).texOffs(0, 0).addBox(-0.5f, -0.9955f, -5.05f, 1.0f, 2.0f, 1.0f, new CubeDeformation(0.0f)), PartPose.offsetAndRotation(0.0f, 0.0f, 0.0f, 0.7854f, 0.0f, 0.0f));
        partdefinition.addOrReplaceChild("back_wheel_sprite", CubeListBuilder.create().texOffs(1, 14).addBox(0.0f, -4.0f, -4.0f, 0.0f, 8.0f, 8.0f, new CubeDeformation(0.0f)), PartPose.offset(0.0f, 19.0f, 9.0f));
        PartDefinition front_wheel_sprite = partdefinition.addOrReplaceChild("front_wheel_sprite", CubeListBuilder.create(), PartPose.offset(0.0f, 19.0f, -8.0f));
        front_wheel_sprite.addOrReplaceChild("front_wheel_sprite_r1", CubeListBuilder.create().texOffs(0, 0).addBox(0.0f, -5.0f, -5.0f, 0.0f, 10.0f, 10.0f, new CubeDeformation(0.0f)), PartPose.offsetAndRotation(0.0f, 0.0f, 0.0f, 0.0873f, 0.0f, 0.0f));
        PartDefinition frame = partdefinition.addOrReplaceChild("frame", CubeListBuilder.create().texOffs(18, 0).addBox(-2.575f, -9.875f, -5.575f, 3.0f, 1.0f, 4.0f, new CubeDeformation(0.0f)), PartPose.offset(0.0f, 19.0f, 9.0f));
        frame.addOrReplaceChild("cube_r1", CubeListBuilder.create().texOffs(24, 0).addBox(-0.575f, -7.625f, -17.925f, 3.0f, 1.0f, 1.0f, new CubeDeformation(0.0f)).texOffs(24, 0).addBox(-1.525f, -7.65f, -17.925f, 1.0f, 1.0f, 1.0f, new CubeDeformation(0.0f)).texOffs(24, 0).addBox(-4.5f, -7.625f, -17.925f, 3.0f, 1.0f, 1.0f, new CubeDeformation(0.0f)).texOffs(21, 16).addBox(-1.525f, -7.65f, -16.925f, 1.0f, 1.0f, 2.0f, new CubeDeformation(0.0f)).texOffs(28, 21).addBox(-1.5f, -7.7f, -6.4f, 1.0f, 10.0f, 1.0f, new CubeDeformation(0.0f)), PartPose.offsetAndRotation(0.0f, 0.0f, 0.0f, -0.2618f, 0.0f, 0.0f));
        frame.addOrReplaceChild("cube_r2", CubeListBuilder.create().texOffs(23, 17).addBox(-1.5f, -5.325f, -16.5f, 1.0f, 11.0f, 1.0f, new CubeDeformation(0.0f)).texOffs(12, 22).addBox(-1.45f, -3.45f, -15.475f, 1.0f, 1.0f, 9.0f, new CubeDeformation(0.0f)), PartPose.offsetAndRotation(0.0f, 0.0f, 0.0f, -0.3491f, 0.0f, 0.0f));
        frame.addOrReplaceChild("cube_r3", CubeListBuilder.create().texOffs(28, 5).addBox(-1.525f, -15.0f, -5.7f, 1.0f, 11.0f, 1.0f, new CubeDeformation(0.0f)), PartPose.offsetAndRotation(0.0f, 0.0f, 0.0f, 0.7418f, 0.0f, 0.0f));
        frame.addOrReplaceChild("cube_r4", CubeListBuilder.create().texOffs(10, 0).addBox(-1.5f, -7.3f, 0.025f, 1.0f, 8.0f, 1.0f, new CubeDeformation(0.0f)), PartPose.offsetAndRotation(0.0f, 0.0f, 0.0f, 0.8727f, 0.0f, 0.0f));
        frame.addOrReplaceChild("cube_r5", CubeListBuilder.create().texOffs(14, 0).addBox(-1.55f, -0.25f, -6.75f, 1.0f, 1.0f, 8.0f, new CubeDeformation(0.0f)), PartPose.offsetAndRotation(0.0f, 0.0f, 0.0f, 0.0873f, 0.0f, 0.0f));
        partdefinition.addOrReplaceChild("crank_arm", CubeListBuilder.create().texOffs(24, 29).addBox(-0.75f, -0.5f, -2.55f, 1.0f, 1.0f, 1.0f, new CubeDeformation(0.0f)).texOffs(11, 0).addBox(0.25f, -0.5f, -2.55f, 0.0f, 1.0f, 3.0f, new CubeDeformation(0.0f)), PartPose.offset(-1.875f, 19.875f, 2.0f));
        return LayerDefinition.create(meshdefinition, 32, 32);
    }

    public void m_7695_(PoseStack poseStack, VertexConsumer buffer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) {
        this.crankset.render(poseStack, buffer, packedLight, packedOverlay);
        this.front_wheel.render(poseStack, buffer, packedLight, packedOverlay);
        this.back_wheel.render(poseStack, buffer, packedLight, packedOverlay);
        this.back_wheel_sprite.render(poseStack, buffer, packedLight, packedOverlay);
        this.front_wheel_sprite.render(poseStack, buffer, packedLight, packedOverlay);
        this.frame.render(poseStack, buffer, packedLight, packedOverlay);
        this.crank_arm.render(poseStack, buffer, packedLight, packedOverlay);
    }

    public void setRotationAngle(ModelPart modelRenderer, float x, float y, float z) {
        modelRenderer.xRot = x;
        modelRenderer.yRot = y;
        modelRenderer.zRot = z;
    }

    public void renderToBufferWithRotation(float wheelRot, PoseStack matrixStack, VertexConsumer buffer, int var3, int var4, float var5, float var6, float var7, float var8) {
        this.crankset.render(matrixStack, buffer, var3, var4, var5, var6, var7, var8);
        setRotationAngle(this.front_wheel_sprite, wheelRot, 0.0f, 0.0f);
        this.front_wheel_sprite.render(matrixStack, buffer, var3, var4, var5, var6, var7, var8);
        this.front_wheel.render(matrixStack, buffer, var3, var4, var5, var6, var7, var8);
        setRotationAngle(this.back_wheel_sprite, wheelRot, 0.0f, 0.0f);
        this.back_wheel_sprite.render(matrixStack, buffer, var3, var4, var5, var6, var7, var8);
        this.back_wheel.render(matrixStack, buffer, var3, var4, var5, var6, var7, var8);
        setRotationAngle(this.crank_arm, wheelRot / 1.2f, 0.0f, 0.0f);
        this.crank_arm.render(matrixStack, buffer, var3, var4, var5, var6, var7, var8);
        this.frame.render(matrixStack, buffer, var3, var4, var5, var6, var7, var8);
    }

    public void setupAnim(BicycleEntity var1, float var2, float var3, float var4, float var5, float var6) {
        this.crankset.visible = true;
        this.front_wheel.visible = true;
        this.front_wheel_sprite.visible = true;
        this.back_wheel.visible = true;
        this.back_wheel_sprite.visible = true;
        this.crank_arm.visible = true;
        this.frame.visible = true;
    }
}
