Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package jip.jipmod.init.modEntityClasses;
- import net.minecraft.client.model.ModelBase;
- import net.minecraft.client.model.ModelRenderer;
- import net.minecraft.client.renderer.GlStateManager;
- import net.minecraft.entity.Entity;
- import net.minecraft.util.MathHelper;
- public class ModelHorror extends ModelBase {
- ModelRenderer head;
- ModelRenderer body;
- ModelRenderer rightArm;
- ModelRenderer leftArm;
- public ModelHorror(){
- textureWidth = 64;
- textureHeight = 64;
- this.head = new ModelRenderer(this,0,46);
- this.head.addBox(-3F, -6F, -4F, 6, 6, 6);
- this.head.setRotationPoint(0F, -9F, 0F);
- this.body = new ModelRenderer(this,32,42);
- this.body.addBox(-4F, 0F, -2F, 8, 12, 4);
- this.body.setRotationPoint(0F, -9F, 0F);
- this.body.setTextureOffset(43, 33).addBox(-3F, 0F, 0F, 6, 3, 3);
- this.body.setTextureOffset( 0, 33).addBox(-2F, 0F, -1F, 4, 10, 2);
- this.leftArm = new ModelRenderer(this,56, 0);
- this.leftArm.addBox(-1F, -2F, -1F, 2, 7, 2);
- this.leftArm.setRotationPoint(5F, -7F, 0F);
- this.leftArm.setTextureOffset( 0, 15).addBox(0F, 0F, 0F, 1, 1, 3);
- this.leftArm.setTextureOffset( 0, 15).addBox(0F, 0F, 0F, 1, 1, 3);
- this.leftArm.setTextureOffset( 0, 15).addBox(0F, 0F, 0F, 1, 1, 3);
- this.leftArm.setTextureOffset( 0, 21).addBox(0F, 2F, -1F, 1, 1, 7);
- this.leftArm.setTextureOffset( 13, 34).addBox(0F, 0F, 0F, 1, 1, 8);
- this.leftArm.setTextureOffset( 49, 25).addBox(-1F, 0F, 0F, 1, 1, 6);
- this.rightArm = new ModelRenderer(this,56,0);
- this.rightArm.addBox(-1F, -2F, -1F, 2, 7, 2);
- this.rightArm.setRotationPoint(-5F, -7F, 0F);
- this.rightArm.setTextureOffset( 0, 15).addBox(0F, 0F, 0F, 1, 1, 3);
- this.rightArm.setTextureOffset( 0, 15).addBox(0F, 0F, 0F, 1, 1, 3);
- this.rightArm.setTextureOffset( 0, 15).addBox(-2F, 0F, 0F, 1, 1, 3);
- this.rightArm.setTextureOffset( 0, 21).addBox(-1F, 0F, 0F, 1, 1, 7);
- this.rightArm.setTextureOffset( 0, 7).addBox(0F, 0F, 0F, 1, 1, 5);
- this.rightArm.setTextureOffset( 0, 0).addBox(-1F, 0F, -1F, 1, 1, 5);
- }
- public void render(Entity entity, float time, float limbSwingDistance, float p_78088_4_, float headYRot, float headXRot, float yTrans) {
- this.setRotationAngles(time, limbSwingDistance, p_78088_4_, headYRot, headXRot, yTrans, entity);
- if(this.isChild){
- float div = 2.0F;
- GlStateManager.pushMatrix();
- GlStateManager.scale(1.0F/div, 1.0F/div, 1.0F/div);
- GlStateManager.translate(0.0F, 24.0F * yTrans, 0.0F );
- this.head.render(yTrans);
- this.body.render(yTrans);
- this.leftArm.render(yTrans);
- this.rightArm.render(yTrans);
- GlStateManager.popMatrix();
- }
- else{
- this.head.render(yTrans);
- this.body.render(yTrans);
- this.leftArm.render(yTrans);
- this.rightArm.render(yTrans);
- }
- }
- public void setRotationAngles(float time, float limbSwingDistance, float p_78087_3_, float headYRot, float headXRot, float p_78087_6_, Entity entity) {
- this.head.rotateAngleX = headXRot/(180F / (float)Math.PI);
- this.head.rotateAngleY = headYRot/(180F / (float)Math.PI);
- this.body.rotateAngleX = ((float)Math.PI/2.0F);
- this.leftArm.rotateAngleX = MathHelper.cos(time * 0.662F + (float)Math.PI) * 1.4F * limbSwingDistance;
- this.rightArm.rotateAngleX = MathHelper.cos(time * 0.662F) * 1.4F * limbSwingDistance;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment