Guest User

Untitled

a guest
Jun 4th, 2021
58
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package net.mcreator.mountainupdta.entity.renderer;
  2.  
  3. import net.minecraftforge.fml.client.registry.RenderingRegistry;
  4. import net.minecraftforge.eventbus.api.SubscribeEvent;
  5. import net.minecraftforge.client.event.ModelRegistryEvent;
  6. import net.minecraftforge.api.distmarker.OnlyIn;
  7. import net.minecraftforge.api.distmarker.Dist;
  8.  
  9. import net.minecraft.util.math.MathHelper;
  10. import net.minecraft.util.ResourceLocation;
  11. import net.minecraft.entity.Entity;
  12. import net.minecraft.client.renderer.model.ModelRenderer;
  13. import net.minecraft.client.renderer.model.Model;
  14. import net.minecraft.client.renderer.entity.model.AgeableModel;
  15. import net.minecraft.client.renderer.entity.MobRenderer;
  16.  
  17. import net.mcreator.mountainupdta.entity.GoatEntity;
  18.  
  19. import com.google.common.collect.ImmutableList;
  20.  
  21. @OnlyIn(Dist.CLIENT)
  22. public class GoatRenderer {
  23. public static class ModelRegisterHandler {
  24. @SubscribeEvent
  25. @OnlyIn(Dist.CLIENT)
  26. public void registerModels(ModelRegistryEvent event) {
  27. RenderingRegistry.registerEntityRenderingHandler(GoatEntity.entity, renderManager -> {
  28. return new MobRenderer(renderManager, new ModelGoatModel(), 0.5f) {
  29. @Override
  30. public ResourceLocation getEntityTexture(Entity entity) {
  31. return new ResourceLocation("newmountains:textures/goat.png");
  32. }
  33. };
  34. });
  35. }
  36. }
  37.  
  38. //
  39. // Decompiled by Procyon v0.5.36
  40. //
  41. @OnlyIn(Dist.CLIENT)
  42. public static class ModelGoatModel<T extends GoatEntity> extends AgeableModel<T> {
  43. private final ModelRenderer headModel;
  44. private final ModelRenderer leftHorn;
  45. private final ModelRenderer rightHorn;
  46. private final ModelRenderer nose;
  47. private final ModelRenderer body;
  48. private final ModelRenderer legBackLeft;
  49. private final ModelRenderer legBackRight;
  50. private final ModelRenderer legFrontLeft;
  51. private final ModelRenderer legFrontRight;
  52. public ModelGoatModel() {
  53. super(true, 19.0f, 1.0f, 2.5f, 2.0f, 24.0f);
  54. this.field_78090_t = 64;
  55. this.field_78089_u = 64;
  56. (this.headModel = new ModelRenderer((Model) this)).func_78793_a(1.0f, 14.0f, 0.0f);
  57. this.headModel.func_78784_a(2, 61).func_228300_a_(2.0f, -11.0f, -10.0f, 3.0f, 2.0f, 1.0f);
  58. this.headModel.func_78784_a(2, 61).func_228300_a_(-6.0f, -11.0f, -10.0f, 3.0f, 2.0f, 1.0f);
  59. this.headModel.func_78784_a(23, 52).func_228300_a_(-0.5f, -3.0f, -14.0f, 0.0f, 7.0f, 5.0f);
  60. (this.leftHorn = new ModelRenderer((Model) this)).func_78793_a(0.0f, 0.0f, 0.0f);
  61. this.leftHorn.func_78784_a(12, 55).func_228300_a_(-0.01f, -16.0f, -10.0f, 2.0f, 7.0f, 2.0f);
  62. this.headModel.func_78792_a(this.leftHorn);
  63. (this.rightHorn = new ModelRenderer((Model) this)).func_78793_a(0.0f, 0.0f, 0.0f);
  64. this.rightHorn.func_78784_a(12, 55).func_228300_a_(-2.99f, -16.0f, -10.0f, 2.0f, 7.0f, 2.0f);
  65. this.headModel.func_78792_a(this.rightHorn);
  66. (this.nose = new ModelRenderer((Model) this)).func_78793_a(0.0f, -8.0f, -8.0f);
  67. this.setRotationAngle(this.nose, 0.9599f, 0.0f, 0.0f);
  68. this.nose.func_78784_a(34, 46).func_228300_a_(-3.0f, -4.0f, -8.0f, 5.0f, 7.0f, 10.0f);
  69. this.headModel.func_78792_a(this.nose);
  70. (this.body = new ModelRenderer((Model) this)).func_78793_a(0.0f, 12.0f, 0.0f);
  71. this.body.func_78784_a(1, 1).func_228300_a_(-4.0f, -5.0f, -7.0f, 9.0f, 11.0f, 16.0f);
  72. this.body.func_78784_a(0, 28).func_228300_a_(-5.0f, -6.0f, -8.0f, 11.0f, 14.0f, 11.0f);
  73. (this.legBackLeft = new ModelRenderer((Model) this)).func_78793_a(1.0f, 14.0f, 4.0f);
  74. this.legBackLeft.func_78784_a(36, 29).func_228300_a_(0.0f, 4.0f, 0.0f, 3.0f, 6.0f, 3.0f);
  75. (this.legBackRight = new ModelRenderer((Model) this)).func_78793_a(-3.0f, 14.0f, 4.0f);
  76. this.legBackRight.func_78784_a(49, 29).func_228300_a_(0.0f, 4.0f, 0.0f, 3.0f, 6.0f, 3.0f);
  77. (this.legFrontLeft = new ModelRenderer((Model) this)).func_78793_a(-3.0f, 14.0f, -6.0f);
  78. this.legFrontLeft.func_78784_a(49, 2).func_228300_a_(0.0f, 0.0f, 0.0f, 3.0f, 10.0f, 3.0f);
  79. (this.legFrontRight = new ModelRenderer((Model) this)).func_78793_a(1.0f, 14.0f, -6.0f);
  80. this.legFrontRight.func_78784_a(35, 2).func_228300_a_(0.0f, 0.0f, 0.0f, 3.0f, 10.0f, 3.0f);
  81. }
  82.  
  83. protected Iterable<ModelRenderer> func_225602_a_() {
  84. return (Iterable<ModelRenderer>) ImmutableList.of((Object) this.headModel);
  85. }
  86.  
  87. protected Iterable<ModelRenderer> func_225600_b_() {
  88. return (Iterable<ModelRenderer>) ImmutableList.of((Object) this.body, (Object) this.legBackRight, (Object) this.legBackLeft,
  89. (Object) this.legFrontRight, (Object) this.legFrontLeft);
  90. }
  91.  
  92. public void setRotationAngle(final ModelRenderer modelRenderer, final float x, final float y, final float z) {
  93. modelRenderer.field_78795_f = x;
  94. modelRenderer.field_78796_g = y;
  95. modelRenderer.field_78808_h = z;
  96. }
  97.  
  98. public void setRotationAngles(Entity e, float f, float f1, float f2, float f3, float f4) {
  99. this.legBackLeft.rotateAngleX = MathHelper.cos(f * 1.0F) * -1.0F * f1;
  100. this.legBackRight.rotateAngleX = MathHelper.cos(f * 1.0F) * 1.0F * f1;
  101. this.legFrontLeft.rotateAngleY = MathHelper.cos(f * 1.0F) * -1.0F * f1;
  102. this.legFrontRight.rotateAngleY = MathHelper.cos(f * 1.0F) * 1.0F * f1;
  103. }
  104. }
  105. }
  106.  
RAW Paste Data