Advertisement
Guest User

MinecraftMod

a guest
Jul 21st, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.82 KB | None | 0 0
  1. package net.minecraft.src;
  2.  
  3. /**
  4. * ModelZombie - Either Mojang or a mod author
  5. * Created using Tabula 7.0.0
  6. */
  7. public class ModelScavengerAI extends ModelBase {
  8. public ModelRenderer RArm;
  9. public ModelRenderer RLeg;
  10. public ModelRenderer LLeg;
  11. public ModelRenderer LArm;
  12. public ModelRenderer Body;
  13. public ModelRenderer Head;
  14. public ModelRenderer Tool;
  15. public ModelRenderer BackPack;
  16.  
  17. public ModelScavengerAI() {
  18. this.textureWidth = 64;
  19. this.textureHeight = 64;
  20. this.RLeg = new ModelRenderer(this, 0, 16);
  21. this.RLeg.setRotationPoint(-2.0F, 13.0F, 0.0F);
  22. this.RLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, 0.0F);
  23. this.Body = new ModelRenderer(this, 16, 16);
  24. this.Body.setRotationPoint(0.0F, 2.2F, 0.0F);
  25. this.Body.addBox(-4.0F, 0.0F, -2.0F, 8, 12, 4, 0.0F);
  26. this.BackPack = new ModelRenderer(this, 17, 32);
  27. this.BackPack.setRotationPoint(0.0F, 1.0F, 2.0F);
  28. this.BackPack.addBox(-3.0F, 0.0F, -3.0F, 6, 8, 3, 0.0F);
  29. this.setRotateAngle(BackPack, 0.0F, 3.141592653589793F, 0.0F);
  30. this.Head = new ModelRenderer(this, 0, 0);
  31. this.Head.setRotationPoint(0.0F, 2.2F, 0.0F);
  32. this.Head.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, 0.0F);
  33. this.LArm = new ModelRenderer(this, 40, 16);
  34. this.LArm.mirror = true;
  35. this.LArm.setRotationPoint(5.0F, 4.0F, 0.0F);
  36. this.LArm.addBox(-1.0F, -2.0F, -2.0F, 4, 12, 4, 0.0F);
  37. this.setRotateAngle(LArm, -1.3962634015954636F, 0.10000736613927509F, -0.10000736613927509F);
  38. this.Tool = new ModelRenderer(this, 30, 32);
  39. this.Tool.setRotationPoint(1.6F, 5.0F, -6.0F);
  40. this.Tool.addBox(-0.0F, -8.0F, -8.0F, 1, 16, 16, 0.0F);
  41. this.setRotateAngle(Tool, 0.22759093446006054F, -0.091106186954104F, 0.0F);
  42. this.LLeg = new ModelRenderer(this, 0, 16);
  43. this.LLeg.mirror = true;
  44. this.LLeg.setRotationPoint(2.0F, 13.0F, 0.0F);
  45. this.LLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, 0.0F);
  46. this.RArm = new ModelRenderer(this, 40, 16);
  47. this.RArm.setRotationPoint(-5.0F, 4.0F, 0.0F);
  48. this.RArm.addBox(-3.0F, -2.0F, -2.0F, 4, 12, 4, 0.0F);
  49. this.Body.addChild(this.BackPack);
  50. this.LArm.addChild(this.Tool);
  51. }
  52.  
  53. @Override
  54. public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
  55. GlStateManager.pushMatrix();
  56. GlStateManager.translate(this.RLeg.offsetX, this.RLeg.offsetY, this.RLeg.offsetZ);
  57. GlStateManager.translate(this.RLeg.rotationPointX * f5, this.RLeg.rotationPointY * f5, this.RLeg.rotationPointZ * f5);
  58. GlStateManager.scale(1.0D, 0.9D, 1.0D);
  59. GlStateManager.translate(-this.RLeg.offsetX, -this.RLeg.offsetY, -this.RLeg.offsetZ);
  60. GlStateManager.translate(-this.RLeg.rotationPointX * f5, -this.RLeg.rotationPointY * f5, -this.RLeg.rotationPointZ * f5);
  61. this.RLeg.render(f5);
  62. GlStateManager.popMatrix();
  63. GlStateManager.pushMatrix();
  64. GlStateManager.translate(this.Body.offsetX, this.Body.offsetY, this.Body.offsetZ);
  65. GlStateManager.translate(this.Body.rotationPointX * f5, this.Body.rotationPointY * f5, this.Body.rotationPointZ * f5);
  66. GlStateManager.scale(1.0D, 0.9D, 1.0D);
  67. GlStateManager.translate(-this.Body.offsetX, -this.Body.offsetY, -this.Body.offsetZ);
  68. GlStateManager.translate(-this.Body.rotationPointX * f5, -this.Body.rotationPointY * f5, -this.Body.rotationPointZ * f5);
  69. this.Body.render(f5);
  70. GlStateManager.popMatrix();
  71. GlStateManager.pushMatrix();
  72. GlStateManager.translate(this.Head.offsetX, this.Head.offsetY, this.Head.offsetZ);
  73. GlStateManager.translate(this.Head.rotationPointX * f5, this.Head.rotationPointY * f5, this.Head.rotationPointZ * f5);
  74. GlStateManager.scale(1.0D, 0.9D, 1.0D);
  75. GlStateManager.translate(-this.Head.offsetX, -this.Head.offsetY, -this.Head.offsetZ);
  76. GlStateManager.translate(-this.Head.rotationPointX * f5, -this.Head.rotationPointY * f5, -this.Head.rotationPointZ * f5);
  77. this.Head.render(f5);
  78. GlStateManager.popMatrix();
  79. GlStateManager.pushMatrix();
  80. GlStateManager.translate(this.LArm.offsetX, this.LArm.offsetY, this.LArm.offsetZ);
  81. GlStateManager.translate(this.LArm.rotationPointX * f5, this.LArm.rotationPointY * f5, this.LArm.rotationPointZ * f5);
  82. GlStateManager.scale(1.0D, 0.9D, 1.0D);
  83. GlStateManager.translate(-this.LArm.offsetX, -this.LArm.offsetY, -this.LArm.offsetZ);
  84. GlStateManager.translate(-this.LArm.rotationPointX * f5, -this.LArm.rotationPointY * f5, -this.LArm.rotationPointZ * f5);
  85. this.LArm.render(f5);
  86. GlStateManager.popMatrix();
  87. GlStateManager.pushMatrix();
  88. GlStateManager.translate(this.LLeg.offsetX, this.LLeg.offsetY, this.LLeg.offsetZ);
  89. GlStateManager.translate(this.LLeg.rotationPointX * f5, this.LLeg.rotationPointY * f5, this.LLeg.rotationPointZ * f5);
  90. GlStateManager.scale(1.0D, 0.9D, 1.0D);
  91. GlStateManager.translate(-this.LLeg.offsetX, -this.LLeg.offsetY, -this.LLeg.offsetZ);
  92. GlStateManager.translate(-this.LLeg.rotationPointX * f5, -this.LLeg.rotationPointY * f5, -this.LLeg.rotationPointZ * f5);
  93. this.LLeg.render(f5);
  94. GlStateManager.popMatrix();
  95. GlStateManager.pushMatrix();
  96. GlStateManager.translate(this.RArm.offsetX, this.RArm.offsetY, this.RArm.offsetZ);
  97. GlStateManager.translate(this.RArm.rotationPointX * f5, this.RArm.rotationPointY * f5, this.RArm.rotationPointZ * f5);
  98. GlStateManager.scale(1.0D, 0.9D, 1.0D);
  99. GlStateManager.translate(-this.RArm.offsetX, -this.RArm.offsetY, -this.RArm.offsetZ);
  100. GlStateManager.translate(-this.RArm.rotationPointX * f5, -this.RArm.rotationPointY * f5, -this.RArm.rotationPointZ * f5);
  101. this.RArm.render(f5);
  102. GlStateManager.popMatrix();
  103. }
  104.  
  105. /**
  106. * This is a helper function from Tabula to set the rotation of model parts
  107. */
  108. public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) {
  109. modelRenderer.rotateAngleX = x;
  110. modelRenderer.rotateAngleY = y;
  111. modelRenderer.rotateAngleZ = z;
  112. }
  113.  
  114. public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity)
  115. {
  116. super.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
  117. this.Head.rotateAngleY = f3 / (180F / (float)Math.PI);
  118. this.Head.rotateAngleX = f4 / (180F / (float)Math.PI);
  119. this.LArm.rotateAngleX = MathHelper.cos(f * 1.0F) * -1.0F * f1;
  120. this.RArm.rotateAngleX = MathHelper.cos(f * 1.0F) * 1.0F * f1;
  121. this.LLeg.rotateAngleX = MathHelper.cos(f * 0.6662F + (float)Math.PI) * 2.0F * f1 * 0.5F;
  122. this.RLeg.rotateAngleX = MathHelper.cos(f * 0.6662F) * 2.0F * f1 * 0.5F;
  123. }
  124.  
  125. }
  126.  
  127. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement