Advertisement
Creepinson

Untitled

Jun 20th, 2017
343
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.57 KB | None | 0 0
  1. package me.creepinson.entities.model;
  2.  
  3. import me.creepinson.lib.RefStrings;
  4. import net.minecraft.client.model.ModelRenderer;
  5. import net.minecraft.entity.Entity;
  6. import net.minecraft.util.MathHelper;
  7. import net.minecraft.util.ResourceLocation;
  8. import net.minecraftforge.client.model.AdvancedModelLoader;
  9. import net.minecraftforge.client.model.obj.WavefrontObject;
  10. import obsidianAPI.render.ModelAnimated;
  11.  
  12. /**
  13. * Creepino - Creepinson
  14. * Created using Tabula 5.1.0
  15. */
  16. public class ModelCreepino extends ModelAnimated {
  17.  
  18. private ResourceLocation creepinoTexture = new ResourceLocation("meepersplus:animations/models/Creepino-texturemap.png");
  19. public ModelRenderer Body;
  20. public ModelRenderer Leg;
  21. public ModelRenderer Head;
  22.  
  23.  
  24. public ModelCreepino(String entityName, WavefrontObject wavefrontObj, ResourceLocation textureLocation) {
  25. super(entityName, wavefrontObj, textureLocation);
  26. this.setTexture(creepinoTexture);
  27. this.textureWidth = 128;
  28. this.textureHeight = 128;
  29. this.Leg = new ModelRenderer(this, 39, 44);
  30. this.Leg.setRotationPoint(-2.0F, 9.0F, -2.0F);
  31. this.Leg.addBox(0.0F, 0.0F, 0.0F, 4, 15, 4, 0.0F);
  32. this.Body = new ModelRenderer(this, 92, 0);
  33. this.Body.setRotationPoint(-4.0F, -5.2F, -4.0F);
  34. this.Body.addBox(0.0F, 0.0F, 0.0F, 8, 14, 8, 0.0F);
  35. this.Head = new ModelRenderer(this, 0, 8);
  36. this.Head.setRotationPoint(-3.0F, -11.2F, -3.0F);
  37. this.Head.addBox(0.0F, 0.0F, 0.0F, 6, 6, 6, 0.0F);
  38. this.setRotateAngle(Head, 0.0F, -0.03717551306747922F, 0.0F);
  39. }
  40.  
  41. /*
  42. public ModelCreepino
  43. public ModelCreepino() {
  44.  
  45. }
  46. */
  47. @Override
  48. public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
  49. this.Leg.render(f5);
  50. this.Body.render(f5);
  51. this.Head.render(f5);
  52. }
  53.  
  54. /**
  55. * This is a helper function from Tabula to set the rotation of model parts
  56. */
  57. public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) {
  58. modelRenderer.rotateAngleX = x;
  59. modelRenderer.rotateAngleY = y;
  60. modelRenderer.rotateAngleZ = z;
  61. }
  62. @Override
  63. public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw,
  64. float headPitch, float scaleFactor, Entity entityIn) {
  65. this.Head.rotateAngleX = headPitch / (180F / (float) Math.PI);
  66. this.Leg.rotateAngleX = MathHelper.cos(limbSwing * 0.6662F) * 1.2F * limbSwingAmount;
  67. super.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor,
  68. entityIn);
  69. }
  70.  
  71.  
  72. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement