Advertisement
Guest User

Cubic template

a guest
Apr 25th, 2017
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.54 KB | None | 0 0
  1. @SideOnly(Side.CLIENT)
  2. public class Model_Fox extends ModelBase {
  3.     public ModelRenderer %name%;
  4.  
  5.     public Model_Fox() {
  6.         this.textureWidth = 64;
  7.         this.textureHeight = 64;
  8.  
  9.         this.%name% = new ModelRenderer(this, %u%, %v%);
  10.         this.%name%.setRotationPoint(%originX%, %originY%, %originZ%);
  11.         this.%name%.addBox(%offsetX%, %offsetY%, %offsetZ%, %width%, %height%, %depth%);
  12.         this.setRotationAngles(this.%name%, %rotX%, %rotY%, %rotZ%);
  13.        
  14.         //Optional would need a child/parent system for elements, used to animate the models
  15.         this.%name%.addChild(this.%name%);
  16.     }
  17.  
  18.     @Override
  19.     public void render(Entity entity, float limbSwing, float limbSwingAmount, float ageInTicks, float rotationYaw, float rotationPitch, float scale) {
  20.         super.render(entity, limbSwing, limbSwingAmount, ageInTicks, rotationYaw, rotationPitch, scale);
  21.         setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, rotationYaw, rotationPitch, scale, entity);
  22.         GlStateManager.enableBlend();
  23.         GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
  24.         GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
  25.         GlStateManager.colorLogicOp(GlStateManager.LogicOp.AND);
  26.        
  27.         this.%name%.render(scale);
  28.        
  29.         GlStateManager.disableBlend();
  30.        
  31.     }
  32.  
  33.     public void setRotationAngles(ModelRenderer modelRenderer, float x, float y, float z) {
  34.         modelRenderer.rotateAngleX = x;
  35.         modelRenderer.rotateAngleY = y;
  36.         modelRenderer.rotateAngleZ = z;
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement