Camellias_

ModelVoidConstruct

May 25th, 2018
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 6.67 KB | None | 0 0
  1. package com.camellias.voidaicarcania.entities.models;
  2.  
  3. import com.camellias.voidaicarcania.entities.EntityVoidConstruct;
  4.  
  5. import net.minecraft.client.model.ModelBase;
  6. import net.minecraft.client.model.ModelRenderer;
  7. import net.minecraft.entity.Entity;
  8. import net.minecraft.entity.EntityLivingBase;
  9.  
  10. public class ModelVoidConstruct extends ModelBase
  11. {
  12.     public ModelRenderer Head;
  13.     public ModelRenderer Body;
  14.     public ModelRenderer Hips;
  15.     public ModelRenderer RightArm;
  16.     public ModelRenderer RightHand;
  17.     public ModelRenderer LeftArm;
  18.     public ModelRenderer LeftHand;
  19.     public ModelRenderer RightLeg;
  20.     public ModelRenderer RightFoot;
  21.     public ModelRenderer LeftLeg;
  22.     public ModelRenderer LeftFoot;
  23.     public ModelRenderer Heart1;
  24.     public ModelRenderer Heart2;
  25.     public ModelRenderer Heart3;
  26.     public ModelRenderer Vessel1;
  27.     public ModelRenderer Vessel2;
  28.     public ModelRenderer Vessel3;
  29.    
  30.     public ModelVoidConstruct()
  31.     {
  32.         this.textureWidth = 256;
  33.         this.textureHeight = 128;
  34.        
  35.         this.Head = new ModelRenderer(this, 0, 0);
  36.         this.Head.setRotationPoint(0.0F, -27.0F, -2.0F);
  37.         this.Head.addBox(-6.0F, -14.0F, -6.0F, 12, 14, 12, 0.0F);
  38.        
  39.         this.Body = new ModelRenderer(this, 0, 26);
  40.         this.Body.setRotationPoint(0.0F, -7.0F, 6.0F);
  41.         this.Body.addBox(-16.0F, -24.0F, -10.0F, 32, 24, 20, 0.0F);
  42.         this.setRotateAngle(Body, 0.34906584024429316F, -0.0F, 0.0F);
  43.        
  44.         this.RightArm = new ModelRenderer(this, 104, 0);
  45.         this.RightArm.setRotationPoint(-16.0F, -25.0F, 0.0F);
  46.         this.RightArm.addBox(-6.0F, -2.0F, -5.0F, 6, 20, 10, 0.0F);
  47.        
  48.         this.RightHand = new ModelRenderer(this, 104, 30);
  49.         this.RightHand.setRotationPoint(-19.0F, -9.0F, 0.0F);
  50.         this.RightHand.addBox(-5.0F, 0.0F, -6.0F, 8, 16, 12, 0.0F);
  51.         this.setRotateAngle(RightHand, -0.13962634015954636F, -0.0F, 0.0F);
  52.        
  53.         this.LeftArm = new ModelRenderer(this, 104, 0);
  54.         this.LeftArm.setRotationPoint(16.0F, -25.0F, 0.0F);
  55.         this.LeftArm.addBox(0.0F, -2.0F, -5.0F, 6, 20, 10, 0.0F);
  56.        
  57.         this.LeftHand = new ModelRenderer(this, 104, 30);
  58.         this.LeftHand.setRotationPoint(19.0F, -9.0F, 0.0F);
  59.         this.LeftHand.addBox(-3.0F, 0.0F, -6.0F, 8, 16, 12, 0.0F);
  60.         this.setRotateAngle(LeftHand, -0.13962634015954636F, -0.0F, 0.0F);
  61.        
  62.         this.Hips = new ModelRenderer(this, 0, 70);
  63.         this.Hips.setRotationPoint(0.0F, -1.0F, 10.0F);
  64.         this.Hips.addBox(-8.0F, -8.0F, -4.0F, 16, 8, 8, 0.0F);
  65.         this.setRotateAngle(Hips, 0.6108652353286743F, -0.0F, 0.0F);
  66.        
  67.         this.RightLeg = new ModelRenderer(this, 0, 86);
  68.         this.RightLeg.setRotationPoint(-8.0F, -3.0F, 8.0F);
  69.         this.RightLeg.addBox(-4.0F, 0.0F, -4.0F, 8, 16, 8, 0.0F);
  70.         this.setRotateAngle(RightLeg, -0.6108652353286743F, -0.0F, 0.0F);
  71.        
  72.         this.RightFoot = new ModelRenderer(this, 32, 86);
  73.         this.RightFoot.setRotationPoint(-8.0F, 8.0F, 0.0F);
  74.         this.RightFoot.addBox(-5.0F, 0.0F, -5.0F, 10, 16, 10, 0.0F);
  75.        
  76.         this.LeftLeg = new ModelRenderer(this, 0, 86);
  77.         this.LeftLeg.setRotationPoint(8.0F, -3.0F, 8.0F);
  78.         this.LeftLeg.addBox(-4.0F, 0.0F, -4.0F, 8, 16, 8, 0.0F);
  79.         this.setRotateAngle(LeftLeg, -0.6108652353286743F, -0.0F, 0.0F);
  80.        
  81.         this.LeftFoot = new ModelRenderer(this, 32, 86);
  82.         this.LeftFoot.setRotationPoint(8.0F, 8.0F, 0.0F);
  83.         this.LeftFoot.addBox(-5.0F, 0.0F, -5.0F, 10, 16, 10, 0.0F);
  84.        
  85.         this.Heart1 = new ModelRenderer(this, 68, 0);
  86.         this.Heart1.setRotationPoint(0.0F, -19.0F, 0.0F);
  87.         this.Heart1.addBox(-3.0F, 0.0F, -3.0F, 3, 8, 6, 0.0F);
  88.        
  89.         this.Heart2 = new ModelRenderer(this, 48, 0);
  90.         this.Heart2.setRotationPoint(-2.0F, -20.0F, 0.0F);
  91.         this.Heart2.addBox(0.0F, 0.0F, -2.0F, 5, 8, 5, 0.0F);
  92.        
  93.         this.Heart3 = new ModelRenderer(this, 86, 0);
  94.         this.Heart3.setRotationPoint(-3.0F, -18.0F, 0.0F);
  95.         this.Heart3.addBox(-1.0F, 0.0F, -2.0F, 1, 6, 4, 0.0F);
  96.        
  97.         this.Vessel1 = new ModelRenderer(this, 48, 16);
  98.         this.Vessel1.setRotationPoint(2.0F, -22.0F, 1.0F);
  99.         this.Vessel1.addBox(-0.5F, 0.0F, -0.5F, 1, 3, 1, 0.0F);
  100.        
  101.         this.Vessel2 = new ModelRenderer(this, 48, 16);
  102.         this.Vessel2.setRotationPoint(1.0F, -22.0F, -1.0F);
  103.         this.Vessel2.addBox(-0.5F, 0.0F, -0.5F, 1, 3, 1, 0.0F);
  104.        
  105.         this.Vessel3 = new ModelRenderer(this, 48, 16);
  106.         this.Vessel3.setRotationPoint(-1.0F, -22.0F, 1.0F);
  107.         this.Vessel3.addBox(0.0F, 0.0F, 0.0F, 1, 3, 1, 0.0F);
  108.        
  109.         this.RightArm.addChild(this.RightHand);
  110.         this.RightLeg.addChild(this.RightFoot);
  111.         this.LeftArm.addChild(this.LeftHand);
  112.         this.LeftLeg.addChild(this.LeftFoot);
  113.     }
  114.    
  115.     @Override
  116.     public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)
  117.     {
  118.         this.Head.render(f5);
  119.         this.Body.render(f5);
  120.         this.RightArm.render(f5);
  121.         this.RightHand.render(f5);
  122.         this.LeftArm.render(f5);
  123.         this.LeftHand.render(f5);
  124.         this.Hips.render(f5);
  125.         this.RightLeg.render(f5);
  126.         this.RightFoot.render(f5);
  127.         this.LeftLeg.render(f5);
  128.         this.LeftFoot.render(f5);
  129.         this.Heart1.render(f5);
  130.         this.Heart2.render(f5);
  131.         this.Heart3.render(f5);
  132.         this.Vessel1.render(f5);
  133.         this.Vessel2.render(f5);
  134.         this.Vessel3.render(f5);
  135.     }
  136.    
  137.     public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z)
  138.     {
  139.         modelRenderer.rotateAngleX = x;
  140.         modelRenderer.rotateAngleY = y;
  141.         modelRenderer.rotateAngleZ = z;
  142.     }
  143.    
  144.     @Override
  145.     public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch,
  146.             float scaleFactor, Entity entityIn)
  147.     {
  148.         this.Head.rotateAngleY = netHeadYaw * 0.017453292F;
  149.         this.Head.rotateAngleX = headPitch * 0.017453292F;
  150.        
  151.         this.LeftArm.rotateAngleX = 1.5F * this.triangleWave(limbSwing, 13.0F) * limbSwingAmount;
  152.         this.RightArm.rotateAngleX = -1.5F * this.triangleWave(limbSwing, 13.0F) * limbSwingAmount;
  153.        
  154.         this.LeftLeg.rotateAngleX = -1.5F * this.triangleWave(limbSwing, 13.0F) * limbSwingAmount;
  155.         this.RightLeg.rotateAngleX = 1.5F * this.triangleWave(limbSwing, 13.0F) * limbSwingAmount;
  156.     }
  157.  
  158.     private float triangleWave(float f1, float f2)
  159.     {
  160.         return (Math.abs(f1 % f2 - f2 * 0.5F) - f2 * 0.25F) / (f2 * 0.25F);
  161.     }
  162. }
Advertisement
Add Comment
Please, Sign In to add comment