package net.mcreator.fnafmod.client.model;
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.minecraft.util.Mth;
import net.minecraft.world.entity.Entity;

public class ModelFoxy<T extends Entity> extends EntityModel<T> {
   public static final ModelLayerLocation LAYER_LOCATION = new ModelLayerLocation(new ResourceLocation("fnaf_mod", "model_foxy"), "main");
   public final ModelPart Head;
   public final ModelPart LeftArm;
   public final ModelPart RightArm;
   public final ModelPart LeftLeg;
   public final ModelPart RightLeg;
   public final ModelPart Body;

   public ModelFoxy(ModelPart root) {
      this.Head = root.m_171324_("Head");
      this.LeftArm = root.m_171324_("LeftArm");
      this.RightArm = root.m_171324_("RightArm");
      this.LeftLeg = root.m_171324_("LeftLeg");
      this.RightLeg = root.m_171324_("RightLeg");
      this.Body = root.m_171324_("Body");
   }

   public static LayerDefinition createBodyLayer() {
      MeshDefinition meshdefinition = new MeshDefinition();
      PartDefinition partdefinition = meshdefinition.m_171576_();
      PartDefinition Head = partdefinition.m_171599_("Head", CubeListBuilder.m_171558_().m_171514_(0, 0).m_171488_(-3.5F, -8.0F, -3.0F, 7.0F, 7.0F, 6.0F, new CubeDeformation(0.0F)).m_171514_(0, 12).m_171488_(0.0F, -10.0F, -1.0F, 0.0F, 2.0F, 1.0F, new CubeDeformation(0.0F)).m_171514_(0, 17).m_171488_(-1.5F, -10.0F, -1.0F, 3.0F, 2.0F, 0.0F, new CubeDeformation(0.0F)).m_171514_(19, 18).m_171488_(-4.0F, -6.0F, -3.5F, 4.0F, 3.0F, 7.0F, new CubeDeformation(0.0F)).m_171514_(20, 0).m_171488_(-5.5F, -3.0F, -3.0F, 11.0F, 2.0F, 2.0F, new CubeDeformation(0.0F)).m_171514_(42, 7).m_171488_(-2.5F, -3.0F, -6.0F, 5.0F, 2.0F, 3.0F, new CubeDeformation(0.0F)).m_171514_(0, 52).m_171488_(-1.5F, -3.0F, -8.0F, 3.0F, 2.0F, 2.0F, new CubeDeformation(0.0F)).m_171514_(40, 46).m_171488_(-1.5F, -1.0F, -7.5F, 3.0F, 1.0F, 4.0F, new CubeDeformation(0.0F)).m_171514_(55, 50).m_171488_(-1.0F, -4.0F, -8.4F, 2.0F, 1.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.m_171419_(0.0F, -5.8F, 0.0F));
      PartDefinition bone5 = Head.m_171599_("bone5", CubeListBuilder.m_171558_(), PartPose.m_171419_(0.0F, -5.4312F, -4.6113F));
      bone5.m_171599_("Head_r1", CubeListBuilder.m_171558_().m_171514_(20, 16).m_171488_(-3.5F, -2.1F, 0.1F, 7.0F, 1.0F, 0.0F, new CubeDeformation(0.0F)), PartPose.m_171423_(0.0F, 0.0F, 0.0F, -0.8727F, 0.0F, 0.0F));
      PartDefinition Jaw = Head.m_171599_("Jaw", CubeListBuilder.m_171558_().m_171514_(48, 32).m_171488_(-2.0F, 0.502F, -7.6374F, 4.0F, 1.0F, 3.0F, new CubeDeformation(0.0F)).m_171514_(38, 41).m_171488_(-2.5F, 1.002F, -8.1374F, 5.0F, 2.0F, 3.0F, new CubeDeformation(0.0F)), PartPose.m_171419_(0.0F, -0.7F, 0.1F));
      Jaw.m_171599_("cube_r1", CubeListBuilder.m_171558_().m_171514_(38, 36).m_171488_(-2.0F, -1.25F, -3.0F, 4.0F, 1.0F, 4.0F, new CubeDeformation(0.0F)).m_171514_(26, 28).m_171488_(-2.5F, -0.75F, -3.0F, 5.0F, 2.0F, 6.0F, new CubeDeformation(0.0F)), PartPose.m_171423_(0.0F, 1.25F, -2.4F, 0.1745F, 0.0F, 0.0F));
      Jaw.m_171599_("cube_r2", CubeListBuilder.m_171558_().m_171514_(14, 46).m_171488_(-2.5F, -2.75F, 2.0F, 5.0F, 4.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.m_171423_(0.0F, -0.7255F, -2.4457F, -0.3927F, 0.0F, 0.0F));
      Head.m_171599_("RightEar", CubeListBuilder.m_171558_().m_171514_(34, 36).m_171488_(-1.6144F, -4.8199F, -4.8F, 3.0F, 3.0F, 1.0F, new CubeDeformation(0.0F)).m_171514_(20, 4).m_171488_(-1.1144F, -5.8199F, -4.8F, 2.0F, 1.0F, 1.0F, new CubeDeformation(0.0F)).m_171514_(0, 15).m_171488_(-0.6144F, -1.8199F, -4.3F, 1.0F, 2.0F, 0.0F, new CubeDeformation(0.0F)), PartPose.m_171423_(-3.0F, -6.0F, 4.5F, 0.0F, 0.0F, -0.6109F));
      Head.m_171599_("RightEar2", CubeListBuilder.m_171558_().m_171514_(34, 36).m_171488_(-1.3856F, -4.8199F, -4.3F, 3.0F, 3.0F, 1.0F, new CubeDeformation(0.0F)).m_171514_(20, 4).m_171488_(-0.8856F, -5.8199F, -4.3F, 2.0F, 1.0F, 1.0F, new CubeDeformation(0.0F)).m_171514_(0, 15).m_171488_(-0.3856F, -1.8199F, -3.8F, 1.0F, 2.0F, 0.0F, new CubeDeformation(0.0F)), PartPose.m_171423_(3.0F, -6.0F, 4.0F, 0.0F, 0.0F, 0.6109F));
      PartDefinition endo_head = Head.m_171599_("endo_head", CubeListBuilder.m_171558_().m_171514_(52, 22).m_171488_(10.2381F, -1.4048F, 0.7857F, 6.0F, 4.0F, 0.0F, new CubeDeformation(0.0F)).m_171514_(50, 46).m_171488_(9.7381F, -5.4048F, 0.7857F, 7.0F, 4.0F, 0.0F, new CubeDeformation(0.0F)).m_171514_(50, 17).m_171488_(11.7381F, -0.9048F, -3.2143F, 3.0F, 1.0F, 4.0F, new CubeDeformation(0.0F)).m_171514_(0, 32).m_171488_(12.2381F, -0.4048F, 0.7857F, 2.0F, 0.0F, 1.0F, new CubeDeformation(0.0F)).m_171514_(28, 54).m_171488_(12.2381F, -0.4048F, -3.0143F, 2.0F, 1.0F, 3.0F, new CubeDeformation(0.0F)).m_171514_(36, 57).m_171488_(10.6381F, -3.7048F, -1.3143F, 2.0F, 2.0F, 2.0F, new CubeDeformation(0.0F)).m_171514_(37, 51).m_171488_(10.2381F, -4.2048F, -1.8143F, 3.0F, 3.0F, 3.0F, new CubeDeformation(0.0F)).m_171514_(37, 51).m_171488_(13.2381F, -4.2048F, -1.8143F, 3.0F, 3.0F, 3.0F, new CubeDeformation(0.0F)).m_171514_(36, 57).m_171488_(13.8381F, -3.7048F, -1.3143F, 2.0F, 2.0F, 2.0F, new CubeDeformation(0.0F)).m_171514_(20, 0).m_171488_(14.3381F, -3.0048F, -1.4143F, 1.0F, 1.0F, 0.0F, new CubeDeformation(0.0F)).m_171514_(20, 0).m_171488_(11.1381F, -3.2048F, -1.4143F, 1.0F, 1.0F, 0.0F, new CubeDeformation(0.0F)), PartPose.m_171419_(-13.2381F, -1.2952F, -1.0857F));
      PartDefinition endoi_jaw = endo_head.m_171599_("endoi_jaw", CubeListBuilder.m_171558_(), PartPose.m_171419_(13.2381F, 1.8452F, 0.7857F));
      endoi_jaw.m_171599_("cube_r3", CubeListBuilder.m_171558_().m_171514_(28, 54).m_171488_(-1.0F, -0.75F, -1.8F, 2.0F, 1.0F, 3.0F, new CubeDeformation(0.0F)).m_171514_(50, 12).m_171488_(-1.5F, -0.25F, -2.0F, 3.0F, 1.0F, 4.0F, new CubeDeformation(0.0F)), PartPose.m_171423_(0.0F, 0.0F, -2.0F, 0.1745F, 0.0F, 0.0F));
      PartDefinition LeftArm = partdefinition.m_171599_("LeftArm", CubeListBuilder.m_171558_().m_171514_(28, 46).m_171488_(-1.5F, 2.0F, -1.5F, 3.0F, 5.0F, 3.0F, new CubeDeformation(0.0F)).m_171514_(8, 56).m_171488_(-0.5F, 1.5F, -0.5F, 1.0F, 7.0F, 1.0F, new CubeDeformation(0.0F)).m_171514_(56, 26).m_171488_(-0.9F, 6.5F, -1.0F, 2.0F, 2.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.m_171419_(6.0F, -2.0F, 1.0F));
      PartDefinition bone3 = LeftArm.m_171599_("bone3", CubeListBuilder.m_171558_().m_171514_(28, 63).m_171488_(-1.49F, 0.2F, -1.5F, 3.0F, 5.0F, 3.0F, new CubeDeformation(0.0F)).m_171514_(44, 57).m_171488_(-0.5F, 0.2F, -0.5F, 1.0F, 6.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.m_171419_(0.0F, 7.3F, 0.0F));
      bone3.m_171599_("right_hand2", CubeListBuilder.m_171558_().m_171514_(0, 56).m_171488_(-0.21F, 0.7F, -1.5F, 1.0F, 2.0F, 3.0F, new CubeDeformation(0.0F)).m_171514_(20, 17).m_171488_(0.11F, 0.7F, 0.5F, 2.0F, 1.0F, 1.0F, new CubeDeformation(0.0F)).m_171514_(12, 37).m_171488_(-0.31F, 2.2F, -1.5F, 2.0F, 1.0F, 3.0F, new CubeDeformation(0.0F)), PartPose.m_171423_(0.31F, 5.5F, 0.0F, 3.1416F, 0.0F, -3.1416F));
      PartDefinition RightArm = partdefinition.m_171599_("RightArm", CubeListBuilder.m_171558_().m_171514_(28, 46).m_171488_(-1.5F, 2.0F, -1.5F, 3.0F, 5.0F, 3.0F, new CubeDeformation(0.0F)).m_171514_(8, 56).m_171488_(-0.5F, 1.5F, -0.5F, 1.0F, 7.0F, 1.0F, new CubeDeformation(0.0F)).m_171514_(56, 26).m_171488_(-1.0F, 6.5F, -1.0F, 2.0F, 2.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.m_171419_(-6.0F, -2.0F, 1.0F));
      PartDefinition bone2 = RightArm.m_171599_("bone2", CubeListBuilder.m_171558_().m_171514_(44, 57).m_171488_(-0.5F, 0.2F, -0.5F, 1.0F, 6.0F, 1.0F, new CubeDeformation(0.0F)).m_171514_(28, 63).m_171488_(-1.5F, 0.2F, -1.5F, 3.0F, 5.0F, 3.0F, new CubeDeformation(0.0F)), PartPose.m_171419_(0.0F, 7.3F, 0.0F));
      bone2.m_171599_("right_hand", CubeListBuilder.m_171558_().m_171514_(34, 16).m_171488_(-3.91F, 2.1F, 1.0F, 8.0F, 9.0F, 0.0F, new CubeDeformation(0.0F)).m_171514_(51, 40).m_171488_(-1.41F, 1.1F, -0.5F, 3.0F, 1.0F, 3.0F, new CubeDeformation(0.0F)), PartPose.m_171423_(-0.09F, 5.1F, -1.0F, 0.0F, 0.0F, 0.0F));
      PartDefinition LeftLeg = partdefinition.m_171599_("LeftLeg", CubeListBuilder.m_171558_().m_171514_(0, 37).m_171488_(-0.5564F, -0.5F, -2.5019F, 4.0F, 6.0F, 4.0F, new CubeDeformation(0.0F)).m_171514_(56, 26).m_171488_(0.4F, 6.0F, -1.0F, 2.0F, 2.0F, 2.0F, new CubeDeformation(0.0F)).m_171514_(20, 52).m_171488_(0.4F, 0.0F, -1.0F, 2.0F, 6.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.m_171419_(0.6F, 9.0F, 1.0F));
      PartDefinition bone4 = LeftLeg.m_171599_("bone4", CubeListBuilder.m_171558_().m_171514_(0, 47).m_171488_(-0.1F, 6.901F, -2.0F, 3.0F, 1.0F, 4.0F, new CubeDeformation(0.0F)).m_171514_(26, 4).m_171488_(-0.6F, 6.901F, -4.0F, 4.0F, 1.0F, 2.0F, new CubeDeformation(0.0F)).m_171514_(12, 52).m_171488_(0.4F, 1.001F, -1.0F, 2.0F, 6.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.m_171419_(0.0F, 7.0F, 0.0F));
      bone4.m_171599_("RightLeg_r1", CubeListBuilder.m_171558_().m_171514_(0, 13).m_171488_(-1.5F, 1.0F, -4.5F, 2.0F, 0.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.m_171423_(1.8948F, 6.902F, -1.499F, 0.0F, 0.3927F, 0.0F));
      bone4.m_171599_("RightLeg_r2", CubeListBuilder.m_171558_().m_171514_(0, 15).m_171488_(-0.3F, 1.0F, -4.5F, 2.0F, 0.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.m_171423_(0.7205F, 6.902F, -1.5755F, 0.0F, -0.3927F, 0.0F));
      PartDefinition bone9 = bone4.m_171599_("bone9", CubeListBuilder.m_171558_(), PartPose.m_171423_(-0.1F, 7.0F, 0.7F, 0.0F, -0.1309F, 0.0F));
      PartDefinition RightLeg = partdefinition.m_171599_("RightLeg", CubeListBuilder.m_171558_().m_171514_(56, 26).m_171488_(-1.0F, 6.0F, -1.0F, 2.0F, 2.0F, 2.0F, new CubeDeformation(0.0F)).m_171514_(20, 52).m_171488_(-1.0F, 0.0F, -1.0F, 2.0F, 6.0F, 2.0F, new CubeDeformation(0.0F)).m_171514_(22, 36).m_171488_(-2.0436F, -0.5F, -2.5019F, 4.0F, 6.0F, 4.0F, new CubeDeformation(0.0F)), PartPose.m_171419_(-2.0F, 9.0F, 1.0F));
      PartDefinition right_lower_leg = RightLeg.m_171599_("right_lower_leg", CubeListBuilder.m_171558_().m_171514_(12, 52).m_171488_(-1.0F, 1.0F, -1.0F, 2.0F, 6.0F, 2.0F, new CubeDeformation(0.0F)).m_171514_(0, 47).m_171488_(-1.5F, 6.901F, -2.0F, 3.0F, 1.0F, 4.0F, new CubeDeformation(0.0F)).m_171514_(26, 4).m_171488_(-2.0F, 6.901F, -4.0F, 4.0F, 1.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.m_171419_(0.0F, 7.0F, 0.0F));
      right_lower_leg.m_171599_("RightLeg_r3", CubeListBuilder.m_171558_().m_171514_(0, 15).m_171488_(-0.3F, 1.0F, -4.5F, 2.0F, 0.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.m_171423_(-0.6795F, 6.902F, -1.5755F, 0.0F, -0.3927F, 0.0F));
      right_lower_leg.m_171599_("RightLeg_r4", CubeListBuilder.m_171558_().m_171514_(0, 13).m_171488_(-1.5F, 1.0F, -4.5F, 2.0F, 0.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.m_171423_(0.4948F, 6.902F, -1.499F, 0.0F, 0.3927F, 0.0F));
      PartDefinition bone8 = right_lower_leg.m_171599_("bone8", CubeListBuilder.m_171558_(), PartPose.m_171423_(0.0F, 7.0F, 0.7F, 0.0F, 0.1309F, 0.0F));
      PartDefinition Body = partdefinition.m_171599_("Body", CubeListBuilder.m_171558_().m_171514_(20, 7).m_171488_(-4.0F, -13.6F, -3.5F, 8.0F, 3.0F, 6.0F, new CubeDeformation(0.0F)).m_171514_(0, 13).m_171488_(-3.5F, -10.6F, -3.5F, 7.0F, 6.0F, 6.0F, new CubeDeformation(0.0F)).m_171514_(0, 28).m_171488_(-3.5F, -4.5F, -3.5F, 7.0F, 3.0F, 6.0F, new CubeDeformation(0.0F)).m_171514_(56, 26).m_171488_(-6.99F, -13.51F, -0.99F, 2.0F, 2.0F, 2.0F, new CubeDeformation(0.0F)).m_171514_(56, 26).m_171488_(4.99F, -13.51F, -0.99F, 2.0F, 2.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.m_171419_(0.0F, 11.0F, 1.0F));
      Body.m_171599_("LeftArm_r1", CubeListBuilder.m_171558_().m_171514_(42, 0).m_171488_(-0.5F, -1.5F, -2.0F, 3.0F, 2.0F, 4.0F, new CubeDeformation(0.0F)).m_171514_(42, 25).m_171488_(11.5F, -1.5F, -2.0F, 3.0F, 2.0F, 4.0F, new CubeDeformation(0.0F)), PartPose.m_171423_(-6.99F, -13.0F, 0.0F, -0.1745F, 0.0F, 0.0F));
      Body.m_171599_("Body_r1", CubeListBuilder.m_171558_().m_171514_(36, 4).m_171488_(0.0F, -1.5F, 0.0F, 2.0F, 2.0F, 0.0F, new CubeDeformation(0.0F)), PartPose.m_171423_(3.0F, -13.6F, -0.5F, 0.0F, 0.0F, -0.3927F));
      Body.m_171599_("Body_r2", CubeListBuilder.m_171558_().m_171514_(0, 37).m_171488_(-2.0F, -1.5F, 0.0F, 2.0F, 2.0F, 0.0F, new CubeDeformation(0.0F)), PartPose.m_171423_(-3.0F, -13.6F, -0.5F, 0.0F, 0.0F, 0.3927F));
      PartDefinition bone = Body.m_171599_("bone", CubeListBuilder.m_171558_(), PartPose.m_171419_(0.0F, -12.0F, -3.5F));
      Body.m_171599_("endo_torso", CubeListBuilder.m_171558_().m_171514_(52, 0).m_171488_(1.5F, -19.0F, -2.5F, 3.0F, 1.0F, 3.0F, new CubeDeformation(0.0F)).m_171514_(49, 51).m_171488_(2.0F, -25.0F, -2.0F, 2.0F, 8.0F, 2.0F, new CubeDeformation(0.0F)).m_171514_(50, 36).m_171488_(0.5F, -16.5F, -2.0F, 5.0F, 2.0F, 2.0F, new CubeDeformation(0.0F)).m_171514_(55, 5).m_171488_(1.5F, -31.5F, -2.0F, 3.0F, 3.0F, 2.0F, new CubeDeformation(0.0F)).m_171514_(0, 0).m_171488_(1.8F, -30.0F, -1.5F, 1.0F, 5.0F, 1.0F, new CubeDeformation(0.0F)).m_171514_(0, 0).m_171488_(3.2F, -30.0F, -1.5F, 1.0F, 5.0F, 1.0F, new CubeDeformation(0.0F)).m_171514_(0, 28).m_171488_(6.5F, -26.5F, -2.0F, 1.0F, 2.0F, 2.0F, new CubeDeformation(0.0F)).m_171514_(0, 33).m_171488_(7.5F, -26.0F, -1.0F, 2.0F, 1.0F, 0.0F, new CubeDeformation(-0.01F)).m_171514_(0, 33).m_171488_(-3.5F, -26.0F, -1.0F, 2.0F, 1.0F, 0.0F, new CubeDeformation(-0.01F)).m_171514_(0, 28).m_171488_(-1.5F, -26.5F, -2.0F, 1.0F, 2.0F, 2.0F, new CubeDeformation(0.0F)).m_171514_(0, 25).m_171488_(-0.5F, -26.0F, -2.0F, 7.0F, 1.0F, 2.0F, new CubeDeformation(0.0F)), PartPose.m_171419_(-3.0F, 13.0F, 1.0F));
      Body.m_171599_("bone11", CubeListBuilder.m_171558_().m_171514_(4, 0).m_171488_(0.9952F, 10.1022F, -1.5F, 1.0F, 6.0F, 0.0F, new CubeDeformation(0.0F)), PartPose.m_171423_(2.0F, -27.5F, 1.5F, 0.0F, 0.0F, 0.3927F));
      Body.m_171599_("bone10", CubeListBuilder.m_171558_().m_171514_(4, 0).m_171488_(-4.7668F, 8.9542F, -1.5F, 1.0F, 6.0F, 0.0F, new CubeDeformation(0.0F)), PartPose.m_171423_(1.0F, -27.5F, 1.5F, 0.0F, 0.0F, -0.3927F));
      Body.m_171599_("bone7", CubeListBuilder.m_171558_().m_171514_(20, 28).m_171488_(1.2125F, -0.2017F, -1.5F, 6.0F, 6.0F, 0.0F, new CubeDeformation(0.0F)), PartPose.m_171423_(-1.0F, -17.2F, 1.5F, 0.0F, 0.0F, 0.7854F));
      return LayerDefinition.m_171565_(meshdefinition, 128, 128);
   }

   public void m_7695_(PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) {
      this.Head.m_104306_(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha);
      this.LeftArm.m_104306_(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha);
      this.RightArm.m_104306_(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha);
      this.LeftLeg.m_104306_(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha);
      this.RightLeg.m_104306_(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha);
      this.Body.m_104306_(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha);
   }

   public void m_6973_(T entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch) {
      this.RightArm.f_104203_ = Mth.m_14089_(limbSwing * 0.6662F + 3.1415927F) * limbSwingAmount;
      this.LeftLeg.f_104203_ = Mth.m_14089_(limbSwing * 1.0F) * -1.0F * limbSwingAmount;
      this.Head.f_104204_ = netHeadYaw / 57.295776F;
      this.Head.f_104203_ = headPitch / 57.295776F;
      this.LeftArm.f_104203_ = Mth.m_14089_(limbSwing * 0.6662F) * limbSwingAmount;
      this.RightLeg.f_104203_ = Mth.m_14089_(limbSwing * 1.0F) * 1.0F * limbSwingAmount;
   }
}
 

Java online compiler

Write, Run & Share Java code online using OneCompiler's Java online compiler for free. It's one of the robust, feature-rich online compilers for Java language, running the Java LTS version 17. Getting started with the OneCompiler's Java editor is easy and fast. The editor shows sample boilerplate code when you choose language as Java and start coding.

Taking inputs (stdin)

OneCompiler's Java online editor supports stdin and users can give inputs to the programs using the STDIN textbox under the I/O tab. Using Scanner class in Java program, you can read the inputs. Following is a sample program that shows reading STDIN ( A string in this case ).

import java.util.Scanner;
class Input {
    public static void main(String[] args) {
    	Scanner input = new Scanner(System.in);
    	System.out.println("Enter your name: ");
    	String inp = input.next();
    	System.out.println("Hello, " + inp);
    }
}

Adding dependencies

OneCompiler supports Gradle for dependency management. Users can add dependencies in the build.gradle file and use them in their programs. When you add the dependencies for the first time, the first run might be a little slow as we download the dependencies, but the subsequent runs will be faster. Following sample Gradle configuration shows how to add dependencies

apply plugin:'application'
mainClassName = 'HelloWorld'

run { standardInput = System.in }
sourceSets { main { java { srcDir './' } } }

repositories {
    jcenter()
}

dependencies {
    // add dependencies here as below
    implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.9'
}

About Java

Java is a very popular general-purpose programming language, it is class-based and object-oriented. Java was developed by James Gosling at Sun Microsystems ( later acquired by Oracle) the initial release of Java was in 1995. Java 17 is the latest long-term supported version (LTS). As of today, Java is the world's number one server programming language with a 12 million developer community, 5 million students studying worldwide and it's #1 choice for the cloud development.

Syntax help

Variables

short x = 999; 			// -32768 to 32767
int   x = 99999; 		// -2147483648 to 2147483647
long  x = 99999999999L; // -9223372036854775808 to 9223372036854775807

float x = 1.2;
double x = 99.99d;

byte x = 99; // -128 to 127
char x = 'A';
boolean x = true;

Loops

1. If Else:

When ever you want to perform a set of operations based on a condition If-Else is used.

if(conditional-expression) {
  // code
} else {
  // code
}

Example:

int i = 10;
if(i % 2 == 0) {
  System.out.println("i is even number");
} else {
  System.out.println("i is odd number");
}

2. Switch:

Switch is an alternative to If-Else-If ladder and to select one among many blocks of code.

switch(<conditional-expression>) {    
case value1:    
 // code    
 break;  // optional  
case value2:    
 // code    
 break;  // optional  
...    
    
default:     
 //code to be executed when all the above cases are not matched;    
} 

3. For:

For loop is used to iterate a set of statements based on a condition. Usually for loop is preferred when number of iterations is known in advance.

for(Initialization; Condition; Increment/decrement){  
    //code  
} 

4. While:

While is also used to iterate a set of statements based on a condition. Usually while is preferred when number of iterations are not known in advance.

while(<condition>){  
 // code 
}  

5. Do-While:

Do-while is also used to iterate a set of statements based on a condition. It is mostly used when you need to execute the statements atleast once.

do {
  // code 
} while (<condition>); 

Classes and Objects

Class is the blueprint of an object, which is also referred as user-defined data type with variables and functions. Object is a basic unit in OOP, and is an instance of the class.

How to create a Class:

class keyword is required to create a class.

Example:

class Mobile {
    public:    // access specifier which specifies that accessibility of class members 
    string name; // string variable (attribute)
    int price; // int variable (attribute)
};

How to create a Object:

Mobile m1 = new Mobile();

How to define methods in a class:

public class Greeting {
    static void hello() {
        System.out.println("Hello.. Happy learning!");
    }

    public static void main(String[] args) {
        hello();
    }
}

Collections

Collection is a group of objects which can be represented as a single unit. Collections are introduced to bring a unified common interface to all the objects.

Collection Framework was introduced since JDK 1.2 which is used to represent and manage Collections and it contains:

  1. Interfaces
  2. Classes
  3. Algorithms

This framework also defines map interfaces and several classes in addition to Collections.

Advantages:

  • High performance
  • Reduces developer's effort
  • Unified architecture which has common methods for all objects.
CollectionDescription
SetSet is a collection of elements which can not contain duplicate values. Set is implemented in HashSets, LinkedHashSets, TreeSet etc
ListList is a ordered collection of elements which can have duplicates. Lists are classified into ArrayList, LinkedList, Vectors
QueueFIFO approach, while instantiating Queue interface you can either choose LinkedList or PriorityQueue.
DequeDeque(Double Ended Queue) is used to add or remove elements from both the ends of the Queue(both head and tail)
MapMap contains key-values pairs which don't have any duplicates. Map is implemented in HashMap, TreeMap etc.