Advertisement
yarinch

Untitled

Oct 12th, 2014
300
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.00 KB | None | 0 0
  1. public class Model extends ModelBase {
  2.  
  3. //fields
  4. ModelRenderer legLeft;
  5. ModelRenderer legRight;
  6. ModelRenderer body;
  7. ModelRenderer head;
  8. ModelRenderer handLeft;
  9. ModelRenderer handRight;
  10. ModelRenderer connector;
  11.  
  12. public Model() {
  13. textureWidth = 64;
  14. textureHeight = 64;
  15.  
  16. legLeft = new ModelRenderer(this, 0, 20);
  17. legLeft.addBox(-2F, 1F, -2F, 5, 12, 6);
  18. legLeft.setRotationPoint(-4F, 11F, -2F);
  19. legLeft.setTextureSize(64, 64);
  20. legLeft.mirror = true;
  21. setRotation(legLeft, 0F, 0F, 0F);
  22. legRight = new ModelRenderer(this, 0, 0);
  23. legRight.addBox(-2F, 1F, -2F, 5, 12, 6);
  24. legRight.setRotationPoint(3F, 11F, -2F);
  25. legRight.setTextureSize(64, 64);
  26. legRight.mirror = true;
  27. setRotation(legRight, 0F, 0F, 0F);
  28. body = new ModelRenderer(this, 28, 16);
  29. body.addBox(0F, 0F, 0F, 12, 16, 6);
  30. body.setRotationPoint(-6F, -4F, -4F);
  31. body.setTextureSize(64, 64);
  32. body.mirror = true;
  33. setRotation(body, 0F, 0F, 0F);
  34. head = new ModelRenderer(this, 36, 0);
  35. head.addBox(0F, 0F, 0F, 8, 8, 6);
  36. head.setRotationPoint(-4F, -12F, -4F);
  37. head.setTextureSize(64, 64);
  38. head.mirror = true;
  39. setRotation(head, 0F, 0F, 0F);
  40. handLeft = new ModelRenderer(this, 22, 42);
  41. handLeft.addBox(5F, 1F, 0F, 3, 16, 6);
  42. handLeft.setRotationPoint(1F, -5F, -4F);
  43. handLeft.setTextureSize(64, 64);
  44. handLeft.mirror = true;
  45. setRotation(handLeft, 0F, 0F, 0F);
  46. handRight = new ModelRenderer(this, 0, 42);
  47. handRight.addBox(-5F, 1F, 0F, 3, 16, 6);
  48. handRight.setRotationPoint(-4F, -5F, -4F);
  49. handRight.setTextureSize(64, 64);
  50. handRight.mirror = true;
  51. setRotation(handRight, 0F, 0F, 0F);
  52. connector = new ModelRenderer(this, 0, 0);
  53. connector.addBox(0F, 0F, 0F, 2, 3, 6);
  54. connector.setRotationPoint(-1F, 12F, -4F);
  55. connector.setTextureSize(64, 64);
  56. connector.mirror = true;
  57. setRotation(connector, 0F, 0F, 0F);
  58. }
  59.  
  60. public void render(Entity entity, float val1, float val2, float val3, float val4, float val5, float mult) {
  61. super.render(entity, val1, val2, val3, val4, val5, mult);
  62. setRotationAngles(val1, val2, val3, val4, val5, mult, entity);
  63. legLeft.render(mult);
  64. legRight.render(mult);
  65. body.render(mult);
  66. head.render(mult);
  67. handLeft.render(mult);
  68. handRight.render(mult);
  69. connector.render(mult);
  70. }
  71.  
  72. private void setRotation(ModelRenderer model, float x, float y, float z) {
  73. model.rotateAngleX = x;
  74. model.rotateAngleY = y;
  75. model.rotateAngleZ = z;
  76. }
  77.  
  78. public void setRotationAngles(float val1, float val2, float val3, float val4, float val5, float mult, Entity entity) {
  79.  
  80. super.setRotationAngles(val1, val2, val3, val4, val5, mult, entity);
  81. }
  82. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement