Advertisement
Guest User

ModelNPC.java

a guest
Feb 5th, 2016
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.92 KB | None | 0 0
  1. package com.bluehex.bh_housing.client.model;
  2.  
  3. import net.minecraft.client.model.ModelBiped;
  4. import net.minecraft.client.model.ModelRenderer;
  5. import net.minecraft.entity.Entity;
  6.  
  7. public class ModelNPC extends ModelBiped
  8. {
  9.   public ModelNPC()
  10.   {
  11.     textureWidth = 64;
  12.     textureHeight = 32;
  13.    
  14.       this.bipedHead = new ModelRenderer(this, 0, 0);
  15.       this.bipedHead.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8);
  16.       this.bipedHead.setRotationPoint(0F, 0F, 0F);
  17.       this.bipedHead.setTextureSize(64, 32);
  18.       this.bipedHead.mirror = true;
  19.       setRotation(this.bipedHead, 0F, 0F, 0F);
  20.       this.bipedBody = new ModelRenderer(this, 16, 16);
  21.       this.bipedBody.addBox(-4F, 0F, -2F, 8, 12, 4);
  22.       this.bipedBody.setRotationPoint(0F, 0F, 0F);
  23.       this.bipedBody.setTextureSize(64, 32);
  24.       this.bipedBody.mirror = true;
  25.       setRotation(this.bipedBody, 0F, 0F, 0F);
  26.       this.bipedRightArm = new ModelRenderer(this, 40, 16);
  27.       this.bipedRightArm.addBox(-3F, -2F, -2F, 4, 12, 4);
  28.       this.bipedRightArm.setRotationPoint(-5F, 2F, 0F);
  29.       this.bipedRightArm.setTextureSize(64, 32);
  30.       this.bipedRightArm.mirror = true;
  31.       setRotation(this.bipedRightArm, 0F, 0F, 0F);
  32.       this.bipedLeftArm = new ModelRenderer(this, 40, 16);
  33.       this.bipedLeftArm.addBox(-1F, -2F, -2F, 4, 12, 4);
  34.       this.bipedLeftArm.setRotationPoint(5F, 2F, 0F);
  35.       this.bipedLeftArm.setTextureSize(64, 32);
  36.       this.bipedLeftArm.mirror = true;
  37.       setRotation(this.bipedLeftArm, 0F, 0F, 0F);
  38.       this.bipedRightLeg = new ModelRenderer(this, 0, 16);
  39.       this.bipedRightLeg.addBox(-2F, 0F, -2F, 4, 12, 4);
  40.       this.bipedRightLeg.setRotationPoint(-2F, 12F, 0F);
  41.       this.bipedRightLeg.setTextureSize(64, 32);
  42.       this.bipedRightLeg.mirror = true;
  43.       setRotation(this.bipedRightLeg, 0F, 0F, 0F);
  44.       this.bipedLeftLeg = new ModelRenderer(this, 0, 16);
  45.       this.bipedLeftLeg.addBox(-2F, 0F, -2F, 4, 12, 4);
  46.       this.bipedLeftLeg.setRotationPoint(2F, 12F, 0F);
  47.       this.bipedLeftLeg.setTextureSize(64, 32);
  48.       this.bipedLeftLeg.mirror = true;
  49.       setRotation(this.bipedLeftLeg, 0F, 0F, 0F);
  50.   }
  51.  
  52.   @Override
  53.   public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)
  54.   {
  55.     super.render(entity, f, f1, f2, f3, f4, f5);
  56.     setRotationAngles(f, f1, f2, f3, f4, f5, entity);
  57.     this.bipedHead.render(f5);
  58.     this.bipedBody.render(f5);
  59.     this.bipedRightArm.render(f5);
  60.     this.bipedLeftArm.render(f5);
  61.     this.bipedRightLeg.render(f5);
  62.     this.bipedLeftLeg.render(f5);
  63.   }
  64.  
  65.  
  66.   private void setRotation(ModelRenderer model, float x, float y, float z)
  67.   {
  68.     model.rotateAngleX = x;
  69.     model.rotateAngleY = y;
  70.     model.rotateAngleZ = z;
  71.   }
  72.  
  73.   @Override
  74.   public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entityIn)
  75.   {
  76.     super.setRotationAngles(f, f1, f2, f3, f4, f5, entityIn);
  77.   }
  78. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement