Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Date: 29/11/2014 22:25:38
- // Template version 1.1
- // Java generated by Techne
- // Keep in mind that you still need to fill in some blanks
- // - ZeuX
- package fr.yannblanc.aliceadsl.agriculcraft.client.render;
- import net.minecraft.client.model.ModelBiped;
- import net.minecraft.client.model.ModelRenderer;
- import net.minecraft.entity.Entity;
- import net.minecraft.entity.EntityLivingBase;
- import org.lwjgl.opengl.GL11;
- public class ModelChapeau extends ModelBiped
- {
- // fields
- ModelRenderer chapeaubas;
- ModelRenderer chapeauhaut;
- public ModelChapeau()
- {
- textureWidth = 128;
- textureHeight = 64;
- chapeaubas = new ModelRenderer(this, 80, 0);
- chapeaubas.addBox(-6F, -0.5F, -6F, 12, 1, 12);
- chapeaubas.setRotationPoint(0F, -8.5F, 0F);
- chapeaubas.setTextureSize(128, 64);
- chapeaubas.mirror = true;
- setRotation(chapeaubas, 0F, 0F, 0F);
- chapeauhaut = new ModelRenderer(this, 90, 17);
- chapeauhaut.addBox(-4F, -2F, -4F, 8, 2, 8);
- chapeauhaut.setRotationPoint(0F, -9F, 0F);
- chapeauhaut.setTextureSize(128, 64);
- chapeauhaut.mirror = true;
- setRotation(chapeauhaut, 0F, 0F, 0F);
- }
- public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)
- {
- super.render(entity, f, f1, f2, f3, f4, f5);
- setRotationAngles(f, f1, f2, f3, f4, f5, entity);
- chapeaubas.render(f5);
- chapeauhaut.render(f5);
- }
- private void setRotation(ModelRenderer model, float x, float y, float z)
- {
- model.rotateAngleX = x;
- model.rotateAngleY = y;
- model.rotateAngleZ = z;
- }
- public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity)
- {
- super.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
- this.chapeauhaut.rotateAngleY = f3 / (180F / (float)Math.PI);
- this.chapeauhaut.rotateAngleX = f4 / (180F / (float)Math.PI);
- this.chapeaubas.rotateAngleY = f3 / (180F / (float)Math.PI);
- this.chapeaubas.rotateAngleX = f4 / (180F / (float)Math.PI);
- this.chapeauhaut.rotateAngleZ = f5 / (180F / (float)Math.PI);
- this.chapeaubas.rotateAngleZ = f5 / (180F / (float)Math.PI);
- }
- public void setLivingAnimations(EntityLivingBase ent, float x, float y, float z, float partialTime)
- {
- super.setRotationAngles(0, 0, 0, x * (180f / (float)Math.PI), y * (180f / (float)Math.PI), z * (180f / (float)Math.PI), ent);
- }
- public void render1(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7)
- {
- if(par1Entity instanceof EntityLivingBase)
- {
- EntityLivingBase entity = (EntityLivingBase)par1Entity;
- GL11.glPushMatrix();
- float y = 1.5f;
- if(entity.isSneaking())
- y = 1.53f;
- GL11.glRotated(180, 0.0D, 0.0D, 1.0D);
- GL11.glRotated(180, 0.0d, 1.0d, 0.0d);
- GL11.glTranslatef(0.0f, -y, 0.0f);
- GL11.glScalef(0.045f, 0.045f, 0.045f);
- float factor = 1f / 0.045f;
- GL11.glTranslated(0.0d, 1.5f * factor, 0.0f);
- GL11.glRotated(-par5, 0.0f, 1.0f, 0.0f);
- GL11.glTranslated(0.0d, -y * factor, 0.0f);
- GL11.glTranslated(0.0d, y * factor, 0.0f);
- GL11.glRotatef(par6, 1.0f, 0.0f, 0.0f);
- GL11.glTranslated(0.0d, -y * factor, 0.0f);
- GL11.glShadeModel(GL11.GL_SMOOTH);
- this.render(par1Entity, factor, factor, factor, factor, factor, factor);
- GL11.glPopMatrix();
- }
- }
- private float interpolateRotation(float par1, float par2, float par3)
- {
- float f3;
- for (f3 = par2 - par1; f3 < -180.0F; f3 += 360.0F)
- {
- ;
- }
- while (f3 >= 180.0F)
- {
- f3 -= 360.0F;
- }
- return par1 + par3 * f3;
- }
- public static void render()
- {
- // TODO Auto-generated method stub
- }
- public void setLivingAnimations(EntityLivingBase ent, float x, float y, float partialTime)
- {
- super.setRotationAngles(0,0,0,x*(180f/(float)Math.PI),y*(180f/(float)Math.PI),0.0625F, ent);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement