Advertisement
Mudbill

Golem Model

Jun 24th, 2013
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 3.53 KB | None | 0 0
  1. public class ModelGolem extends ModelBase
  2. {
  3.     public ModelRenderer legRight;
  4.     public ModelRenderer legLeft;
  5.     public ModelRenderer bodyLow;
  6.     public ModelRenderer bodyMed;
  7.     public ModelRenderer bodyTop;
  8.     public ModelRenderer armRightSmall;
  9.     public ModelRenderer armLeftSmall;
  10.     public ModelRenderer armRightMain;
  11.     public ModelRenderer armLeftMain;
  12.    
  13.     public ModelGolem(float f) { }
  14.    
  15.     public ModelGolem()
  16.     {
  17.         textureWidth = 64;
  18.         textureHeight = 64;
  19.        
  20.         legRight = new ModelRenderer(this, 32, 28);
  21.         legRight.addBox(-6.0F, 0.0F, -2.0F, 4, 8, 4, 1);
  22.         legRight.setTextureSize(64, 64);
  23.         legRight.setRotationPoint(0, 15, 0);
  24.        
  25.         legLeft = new ModelRenderer(this, 32, 28);
  26.         legLeft.addBox(2.0F, 0.0F, -2.0F, 4, 8, 4, 1);
  27.         legLeft.setTextureSize(64, 64);
  28.         legLeft.setRotationPoint(0, 15, 0);
  29.        
  30.         bodyLow = new ModelRenderer(this, 0, 28);
  31.         bodyLow.addBox(-6.0F, -4.0F, -2.0F, 12, 4, 4, 2);
  32.         bodyLow.setTextureSize(64, 64);
  33.         bodyLow.setRotationPoint(0, 12, 0);
  34.        
  35.         bodyMed = new ModelRenderer(this, 0, 16);
  36.         bodyMed.addBox(-8.0F, -12.0F, -3.0F, 16, 6, 6, 2);
  37.         bodyMed.setTextureSize(64, 64);
  38.         bodyMed.setRotationPoint(0, 10, 0);
  39.        
  40.         bodyTop = new ModelRenderer(this, 0, 0);
  41.         bodyTop.addBox(-10.0F, -24.0F, -4.0F, 20, 8, 8, 2);
  42.         bodyTop.setTextureSize(64, 64);
  43.         bodyTop.setRotationPoint(0, 10, 0);
  44.        
  45.         armRightSmall = new ModelRenderer(this, 44, 16);
  46.         armRightSmall.addBox(-12.0F, -10.0F, -2.0F, 2, 10, 4, 0);
  47.         armRightSmall.setTextureSize(64, 64);
  48.         armRightSmall.setRotationPoint(0, 10, 0);
  49.        
  50.         armLeftSmall = new ModelRenderer(this, 44, 16);
  51.         armLeftSmall.addBox(10.0F, -10.0F, -2.0F, 2, 10, 4, 0);
  52.         armLeftSmall.setTextureSize(64, 64);
  53.         armLeftSmall.setRotationPoint(0, 10, 0);
  54.        
  55.         armRightMain = new ModelRenderer(this, 44, 16);
  56.         armRightMain.addBox(-14.0F, -22.0F, -2.0F, 2, 12, 4, 0);
  57.         armRightMain.setTextureSize(64, 64);
  58.         armRightMain.setRotationPoint(0, 10, 0);
  59.        
  60.         armLeftMain = new ModelRenderer(this, 44, 16);
  61.         armLeftMain.addBox(12.0F, -22.0F, -2.0F, 2, 12, 4, 0);
  62.         armLeftMain.setTextureSize(64, 64);
  63.         armLeftMain.setRotationPoint(0, 10, 0);
  64.        
  65.     }
  66.    
  67.     public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)
  68.     {
  69.         super.render(entity, f, f1, f2, f3, f4, f5);
  70.         this.setRotationAngles(f, f1, f2, f3, f4, f5);
  71.         legRight.render(f5);
  72.         legLeft.render(f5);
  73.         bodyLow.render(f5);
  74.         bodyMed.render(f5);
  75.         bodyTop.render(f5);
  76.         armRightSmall.render(f5);
  77.         armLeftSmall.render(f5);
  78.         armRightMain.render(f5);
  79.         armLeftMain.render(f5);
  80.     }
  81.  
  82.     public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5)
  83.     {
  84.         float lookX = f4 / 110;
  85.         float lookY = f3 / 105;
  86.         float swingX = MathHelper.cos(f * 1.6662F) * 1.0F * f1;
  87.         float swingXopposite = MathHelper.cos(f * 1.6662F + (float)Math.PI) * 1.0F * f1;
  88.        
  89.         super.setRotationAngles(f, f1, f2, f3, f4, f5, null);
  90.         this.bodyLow.rotateAngleX = lookX;
  91.         this.bodyLow.rotateAngleY = lookY;
  92.         this.bodyMed.rotateAngleX = lookX;
  93.         this.bodyMed.rotateAngleY = lookY;
  94.         this.bodyTop.rotateAngleX = lookX;
  95.         this.bodyTop.rotateAngleY = lookY;
  96.         this.armRightSmall.rotateAngleX = lookX;
  97.         this.armRightSmall.rotateAngleY = lookY;
  98.         this.armRightMain.rotateAngleY = lookY;
  99.         this.armLeftSmall.rotateAngleY = lookY;
  100.         this.armLeftSmall.rotateAngleX = lookX;
  101.         this.armLeftMain.rotateAngleY = lookY;
  102.        
  103.         this.legRight.rotateAngleX = swingX;
  104.         this.legLeft.rotateAngleX = swingXopposite;
  105.         this.armLeftMain.rotateAngleX = lookX;
  106.         this.armRightMain.rotateAngleX = lookX;
  107.     }
  108.    
  109. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement