Advertisement
lol123406

Armor model class

Apr 28th, 2015
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.70 KB | None | 0 0
  1.  
  2. package net.Ethereal.armor;
  3.  
  4. import net.minecraft.client.model.ModelBiped;
  5. import net.minecraft.client.model.ModelRenderer;
  6. import net.minecraft.entity.Entity;
  7.  
  8.  
  9. public class ArmorModel extends ModelBiped
  10. {
  11.   //fields
  12.     ModelRenderer LeftShoulder;
  13.     ModelRenderer RightShoulder;
  14.     ModelRenderer VisorL;
  15.     ModelRenderer VisorButton;
  16.     ModelRenderer VisorLens;
  17.     ModelRenderer VisorR;
  18.      
  19.   public ArmorModel(float expand){
  20.      
  21.       super(expand, 0 ,64, 64);
  22.      
  23.       LeftShoulder = new ModelRenderer(this, 0, 32);
  24.       LeftShoulder.addBox(0F, 0F, 0F, 6, 6, 6);
  25.       LeftShoulder.setRotationPoint(0F, 0F, 0F);
  26.       LeftShoulder.setTextureSize(64, 64);
  27.       LeftShoulder.mirror = true;
  28.       setRotation(LeftShoulder, 0F, 0F, 0F);
  29.      
  30.       RightShoulder = new ModelRenderer(this, 24, 32);
  31.       RightShoulder.addBox(0F, 0F, 0F, 6, 6, 6);
  32.       RightShoulder.setRotationPoint(0F, 0F, 0F);
  33.       RightShoulder.setTextureSize(64, 64);
  34.       RightShoulder.mirror = true;
  35.       setRotation(RightShoulder, 0F, 0F, 0F);
  36.      
  37.       VisorL = new ModelRenderer(this, 24, 0);
  38.       VisorL.addBox(0F, 0F, 0F, 1, 3, 3);
  39.       VisorL.setRotationPoint(0F, 0F, 0F);
  40.       VisorL.setTextureSize(64, 64);
  41.       VisorL.mirror = true;
  42.       setRotation(VisorL, 0F, 0F, 0F);
  43.      
  44.       VisorButton = new ModelRenderer(this, 32, 0);
  45.       VisorButton.addBox(0F, 0F, 0F, 1, 1, 1);
  46.       VisorButton.setRotationPoint(0F, 0F, 0F);
  47.       VisorButton.setTextureSize(64, 64);
  48.       VisorButton.mirror = true;
  49.       setRotation(VisorButton, 0F, 0F, 0F);
  50.      
  51.       VisorLens = new ModelRenderer(this, 1, 44);
  52.       VisorLens.addBox(0F, 0F, 0F, 10, 2, 2);
  53.       VisorLens.setRotationPoint(0F, 0F, 0F);
  54.       VisorLens.setTextureSize(64, 64);
  55.       VisorLens.mirror = true;
  56.       setRotation(VisorLens, 0F, 0F, 0F);
  57.      
  58.       VisorR = new ModelRenderer(this, 0, 0);
  59.       VisorR.addBox(0F, 0F, 0F, 1, 3, 3);
  60.       VisorR.setRotationPoint(0F, 0F, 0F);
  61.       VisorR.setTextureSize(64, 64);
  62.       VisorR.mirror = true;
  63.       setRotation(VisorR, 0F, 0F, 0F);
  64.      
  65.       VisorLens.addChild(VisorL);
  66.       VisorLens.addChild(VisorR);
  67.       VisorLens.addChild(VisorButton);
  68.       this.bipedHead.addChild(VisorLens);
  69.       this.bipedLeftArm.addChild(LeftShoulder);
  70.       this.bipedRightArm.addChild(RightShoulder);
  71.     }
  72.  
  73.   public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
  74.         super.render(entity, f, f1, f2, f3, f4, f5);
  75.         setRotationAngles(f, f1, f2, f3, f4, f5, entity);
  76.       }
  77.  
  78.   private void setRotation(ModelRenderer model, float x, float y, float z)
  79.   {
  80.     model.rotateAngleX = x;
  81.     model.rotateAngleY = y;
  82.     model.rotateAngleZ = z;
  83.   }
  84. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement