Advertisement
Guest User

ModelRenderer Code

a guest
Aug 23rd, 2021
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.08 KB | None | 0 0
  1. package net.mcreator.semiparallel.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.ResourceLocation;
  10. import net.minecraft.entity.Entity;
  11. import net.minecraft.client.renderer.model.ModelRenderer;
  12. import net.minecraft.client.renderer.entity.model.EntityModel;
  13. import net.minecraft.client.renderer.entity.MobRenderer;
  14.  
  15. import net.mcreator.semiparallel.entity.SatyrEntity;
  16.  
  17. import com.mojang.blaze3d.vertex.IVertexBuilder;
  18. import com.mojang.blaze3d.matrix.MatrixStack;
  19.  
  20. @OnlyIn(Dist.CLIENT)
  21. public class SatyrRenderer {
  22. public static class ModelRegisterHandler {
  23. @SubscribeEvent
  24. @OnlyIn(Dist.CLIENT)
  25. public void registerModels(ModelRegistryEvent event) {
  26. RenderingRegistry.registerEntityRenderingHandler(SatyrEntity.entity, renderManager -> {
  27. return new MobRenderer(renderManager, new ModelSPSatyr(), 0.5f) {
  28. @Override
  29. public ResourceLocation getEntityTexture(Entity entity) {
  30. return new ResourceLocation("semiparallel:textures/spsatyr.png");
  31. }
  32. };
  33. });
  34. }
  35. }
  36.  
  37. // Made with Blockbench 3.8.4
  38. // Exported for Minecraft version 1.15 - 1.16
  39. // Paste this class into your mod and generate all required imports
  40. public static class ModelSPSatyr extends EntityModel<Entity> {
  41. private final ModelRenderer righthind;private final ModelRenderer 3_ r1;private final ModelRenderer 2_ r1;private final ModelRenderer 1_ r1;
  42. private final ModelRenderer lefthind;private final ModelRenderer 7_ r1;private final ModelRenderer 6_ r1;private final ModelRenderer 5_ r1;
  43. private final ModelRenderer torso;private final ModelRenderer 11_ r1;private final ModelRenderer 10_ r1;private final ModelRenderer 9_ r1;
  44. private final ModelRenderer head;private final ModelRenderer 13_ r1;private final ModelRenderer 12_ r1;
  45. private final ModelRenderer neck_r1;
  46. private final ModelRenderer horn;private final ModelRenderer 21_ r1;private final ModelRenderer 20_ r1;private final ModelRenderer 19_ r1;private final ModelRenderer 18_ r1;private final ModelRenderer 17_ r1;private final ModelRenderer 16_ r1;private final ModelRenderer 15_ r1;private final ModelRenderer 14_ r1;
  47. private final ModelRenderer bb_main;
  48. private final ModelRenderer rightforearm_r1;
  49. private final ModelRenderer leftforearm_r1;
  50. private final ModelRenderer rightupperarm_r1;
  51. private final ModelRenderer leftupperarm_r1;
  52. private final ModelRenderer rightshoulder_r1;
  53. private final ModelRenderer leftshoulder_r1;
  54. private final ModelRenderer rightthigh_r1;
  55. private final ModelRenderer leftthigh_r1;
  56. public ModelSPSatyr() {
  57. textureWidth=256;textureHeight=256;righthind=new ModelRenderer(this);righthind.setRotationPoint(0.0F,22.0F,-1.0F);righthind.setTextureOffset(0,202).addBox(12.0F,-2.0F,-11.0F,-6.0F,4.0F,8.0F,0.0F,false);3_ r1=new ModelRenderer(this);3_ r1.setRotationPoint(0.0F,-2.0F,-1.0F);righthind.addChild(3_ r1);setRotationAngle(3_ r1,-0.0873F,0.0F,0.6981F);3_ r1.setTextureOffset(0,150).addBox(-5.0F,-4.6F,-10.0F,12.0F,4.0F,8.0F,0.0F,false);2_ r1=new ModelRenderer(this);2_ r1.setRotationPoint(-5.6569F,-12.7037F,-0.9097F);righthind.addChild(2_ r1);setRotationAngle(2_ r1,0.0F,0.0F,0.829F);2_ r1.setTextureOffset(4,202).addBox(10.0F,-4.8963F,-9.0903F,-6.0F,6.0F,6.0F,0.0F,false);1_ r1=new ModelRenderer(this);1_ r1.setRotationPoint(-5.6569F,-8.7037F,-0.9097F);righthind.addChild(1_ r1);setRotationAngle(1_ r1,0.0F,0.0F,0.4363F);1_ r1.setTextureOffset(0,170).addBox(10.0F,-22.8963F,-10.0F,-6.0F,24.0F,8.0F,0.0F,false);lefthind=new ModelRenderer(this);lefthind.setRotationPoint(1.0F,24.0F,1.0F);lefthind.setTextureOffset(4,190).addBox(11.0F,-4.0F,3.0F,-6.0F,4.0F,8.0F,0.0F,false);7_ r1=new ModelRenderer(this);7_ r1.setRotationPoint(-1.0F,-4.0F,1.0F);lefthind.addChild(7_ r1);setRotationAngle(7_ r1,0.0873F,0.0F,0.6981F);7_ r1.setTextureOffset(0,138).addBox(-5.0F,-4.6F,2.0F,12.0F,4.0F,8.0F,0.0F,false);6_ r1=new ModelRenderer(this);6_ r1.setRotationPoint(-6.6569F,-14.7037F,0.9097F);lefthind.addChild(6_ r1);setRotationAngle(6_ r1,0.0F,0.0F,0.829F);6_ r1.setTextureOffset(4,202).addBox(10.0F,-4.8963F,3.0903F,-6.0F,6.0F,6.0F,0.0F,false);5_ r1=new ModelRenderer(this);5_ r1.setRotationPoint(-6.6569F,-10.7037F,0.9097F);lefthind.addChild(5_ r1);setRotationAngle(5_ r1,0.0F,0.0F,0.4363F);5_ r1.setTextureOffset(72,138).addBox(10.0F,-22.8963F,2.0F,-6.0F,24.0F,8.0F,0.0F,false);torso=new ModelRenderer(this);torso.setRotationPoint(2.0F,38.0F,4.0F);11_ r1=new ModelRenderer(this);11_ r1.setRotationPoint(-4.0F,-48.0F,4.0F);torso.addChild(11_ r1);setRotationAngle(11_ r1,0.0F,0.0F,0.5236F);11_ r1.setTextureOffset(0,0).addBox(-19.1F,-41.7F,-18.3F,13.0F,15.0F,21.0F,0.3F,false);10_ r1=new ModelRenderer(this);10_ r1.setRotationPoint(-2.0F,-36.0F,4.1F);torso.addChild(10_ r1);setRotationAngle(10_ r1,0.0F,0.0F,0.3054F);10_ r1.setTextureOffset(68,0).addBox(-17.9F,-40.9F,-18.1F,12.0F,14.0F,20.0F,0.1F,false);9_ r1=new ModelRenderer(this);9_ r1.setRotationPoint(2.0F,14.0F,4.0F);torso.addChild(9_ r1);setRotationAngle(9_ r1,0.0F,0.0F,-0.0873F);9_ r1.setTextureOffset(0,36).addBox(-6.0F,-82.0F,-18.0F,12.0F,14.0F,20.0F,0.0F,false);head=new ModelRenderer(this);head.setRotationPoint(0.0F,24.0F,0.0F);13_ r1=new ModelRenderer(this);13_ r1.setRotationPoint(-2.0F,-34.0F,8.2F);head.addChild(13_ r1);setRotationAngle(13_ r1,-0.0017F,0.0F,1.5708F);13_ r1.setTextureOffset(40,138).addBox(-45.3F,-36.3F,-12.7F,7.0F,9.0F,9.0F,0.7F,false);12_ r1=new ModelRenderer(this);12_ r1.setRotationPoint(-2.0F,-34.0F,8.0F);head.addChild(12_ r1);setRotationAngle(12_ r1,0.0F,0.0F,1.5708F);12_ r1.setTextureOffset(64,36).addBox(-53.7F,-31.7F,-15.3F,15.0F,15.0F,15.0F,1.3F,false);neck_r1=new ModelRenderer(this);neck_r1.setRotationPoint(-2.0F,-34.0F,8.0F);head.addChild(neck_r1);setRotationAngle(neck_r1,0.0F,0.0F,1.309F);neck_r1.setTextureOffset(0,70).addBox(-43.7F,-35.7F,-14.3F,13.0F,21.0F,13.0F,-0.7F,false);horn=new ModelRenderer(this);horn.setRotationPoint(-1.0F,-17.0F,4.0F);head.addChild(horn);21_ r1=new ModelRenderer(this);21_ r1.setRotationPoint(-1.0F,-17.0F,4.0F);horn.addChild(21_ r1);setRotationAngle(21_ r1,0.0436F,0.0436F,1.5708F);21_ r1.setTextureOffset(4,176).addBox(-59.7F,-29.7F,-5.3F,5.0F,3.0F,3.0F,1.3F,false);20_ r1=new ModelRenderer(this);20_ r1.setRotationPoint(-1.0F,-17.0F,4.0F);horn.addChild(20_ r1);setRotationAngle(20_ r1,0.0436F,0.0873F,1.309F);20_ r1.setTextureOffset(4,182).addBox(-55.0F,-43.0F,-6.0F,4.0F,2.0F,2.0F,1.0F,false);19_ r1=new ModelRenderer(this);19_ r1.setRotationPoint(-1.0F,-17.0F,4.0F);horn.addChild(19_ r1);setRotationAngle(19_ r1,0.0F,0.0873F,0.6981F);19_ r1.setTextureOffset(4,206).addBox(-24.3F,-66.3F,-4.5F,3.0F,1.0F,1.0F,0.7F,false);18_ r1=new ModelRenderer(this);18_ r1.setRotationPoint(-1.0F,-17.0F,4.0F);horn.addChild(18_ r1);setRotationAngle(18_ r1,0.0F,0.0873F,0.3491F);18_ r1.setTextureOffset(4,202).addBox(-3.6F,-70.6F,-2.2F,3.0F,1.0F,1.0F,0.4F,false);17_ r1=new ModelRenderer(this);17_ r1.setRotationPoint(-1.0F,-17.0F,-12.0F);horn.addChild(17_ r1);setRotationAngle(17_ r1,0.0F,-0.0873F,0.3491F);17_ r1.setTextureOffset(4,204).addBox(-3.6F,-70.6F,0.8F,3.0F,1.0F,1.0F,0.4F,false);16_ r1=new ModelRenderer(this);16_ r1.setRotationPoint(-1.0F,-17.0F,-12.0F);horn.addChild(16_ r1);setRotationAngle(16_ r1,0.0F,-0.0873F,0.6981F);16_ r1.setTextureOffset(4,208).addBox(-24.3F,-66.3F,3.1F,3.0F,1.0F,1.0F,0.7F,false);15_ r1=new ModelRenderer(this);15_ r1.setRotationPoint(-1.0F,-17.0F,-12.0F);horn.addChild(15_ r1);setRotationAngle(15_ r1,-0.0436F,-0.0873F,1.309F);15_ r1.setTextureOffset(4,186).addBox(-55.0F,-43.0F,4.0F,4.0F,2.0F,2.0F,1.0F,false);14_ r1=new ModelRenderer(this);14_ r1.setRotationPoint(-1.0F,-17.0F,-12.0F);horn.addChild(14_ r1);setRotationAngle(14_ r1,-0.0436F,-0.0436F,1.5708F);14_ r1.setTextureOffset(4,170).addBox(-59.7F,-29.7F,2.7F,5.0F,3.0F,3.0F,1.3F,false);bb_main=new ModelRenderer(this);bb_main.setRotationPoint(0.0F,24.0F,0.0F);rightforearm_r1=new ModelRenderer(this);rightforearm_r1.setRotationPoint(12.0F,-18.0F,-22.0F);bb_main.addChild(rightforearm_r1);setRotationAngle(rightforearm_r1,-0.1309F,0.0F,-0.1309F);rightforearm_r1.setTextureOffset(0,104).addBox(-9.5F,-27.5F,-3.5F,5.0F,29.0F,5.0F,1.5F,false);leftforearm_r1=new ModelRenderer(this);leftforearm_r1.setRotationPoint(12.0F,-18.0F,22.0F);bb_main.addChild(leftforearm_r1);setRotationAngle(leftforearm_r1,0.1309F,0.0F,-0.1309F);leftforearm_r1.setTextureOffset(20,104).addBox(-9.5F,-27.5F,-1.5F,5.0F,29.0F,5.0F,1.5F,false);rightupperarm_r1=new ModelRenderer(this);rightupperarm_r1.setRotationPoint(8.0F,-46.0F,-18.0F);bb_main.addChild(rightupperarm_r1);setRotationAngle(rightupperarm_r1,-0.1309F,0.0F,0.1745F);rightupperarm_r1.setTextureOffset(40,104).addBox(-9.5F,-27.5F,-3.5F,5.0F,29.0F,5.0F,1.5F,false);leftupperarm_r1=new ModelRenderer(this);leftupperarm_r1.setRotationPoint(8.0F,-46.0F,18.0F);bb_main.addChild(leftupperarm_r1);setRotationAngle(leftupperarm_r1,0.1309F,0.0F,0.1745F);leftupperarm_r1.setTextureOffset(60,104).addBox(-9.5F,-27.5F,-1.5F,5.0F,29.0F,5.0F,1.5F,false);rightshoulder_r1=new ModelRenderer(this);rightshoulder_r1.setRotationPoint(18.0F,-46.0F,-28.0F);bb_main.addChild(rightshoulder_r1);setRotationAngle(rightshoulder_r1,-0.7854F,-0.7854F,0.7854F);rightshoulder_r1.setTextureOffset(52,70).addBox(-17.6F,-34.2F,7.2F,12.0F,8.0F,12.0F,0.8F,false);leftshoulder_r1=new ModelRenderer(this);leftshoulder_r1.setRotationPoint(18.0F,-46.0F,28.0F);bb_main.addChild(leftshoulder_r1);setRotationAngle(leftshoulder_r1,0.7854F,0.7854F,0.7854F);leftshoulder_r1.setTextureOffset(100,70).addBox(-17.6F,-34.2F,-18.8F,12.0F,8.0F,12.0F,0.8F,false);rightthigh_r1=new ModelRenderer(this);rightthigh_r1.setRotationPoint(-5.6569F,-10.7037F,-1.9097F);bb_main.addChild(rightthigh_r1);setRotationAngle(rightthigh_r1,-0.0873F,0.0F,-0.5236F);rightthigh_r1.setTextureOffset(4,170).addBox(24.0F,-24.8963F,-10.0F,-10.0F,20.0F,8.0F,0.0F,false);leftthigh_r1=new ModelRenderer(this);leftthigh_r1.setRotationPoint(-5.6569F,-10.7037F,1.9097F);bb_main.addChild(leftthigh_r1);setRotationAngle(leftthigh_r1,0.0873F,0.0F,-0.5236F);leftthigh_r1.setTextureOffset(4,170).addBox(24.0F,-24.8963F,2.0F,-10.0F,20.0F,8.0F,0.0F,false);
  58. }
  59.  
  60. @Override
  61. public void setRotationAngles(Entity entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch) {
  62. // previously the render function, render code was moved to a method below
  63. }
  64.  
  65. @Override
  66. public void render(MatrixStack matrixStack, IVertexBuilder buffer, int packedLight, int packedOverlay, float red, float green, float blue,
  67. float alpha) {
  68. righthind.render(matrixStack, buffer, packedLight, packedOverlay);
  69. lefthind.render(matrixStack, buffer, packedLight, packedOverlay);
  70. torso.render(matrixStack, buffer, packedLight, packedOverlay);
  71. head.render(matrixStack, buffer, packedLight, packedOverlay);
  72. bb_main.render(matrixStack, buffer, packedLight, packedOverlay);
  73. }
  74.  
  75. public void setRotationAngle(ModelRenderer modelRenderer, float x, float y, float z) {
  76. modelRenderer.rotateAngleX = x;
  77. modelRenderer.rotateAngleY = y;
  78. modelRenderer.rotateAngleZ = z;
  79. }
  80. }
  81. }
  82.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement