diff --git a/src/main/java/noppes/npcs/client/model/ModelMPM.java b/src/main/java/noppes/npcs/client/model/ModelMPM.java index 6c7ad31de..0052bdc8b 100644 --- a/src/main/java/noppes/npcs/client/model/ModelMPM.java +++ b/src/main/java/noppes/npcs/client/model/ModelMPM.java @@ -66,9 +66,9 @@ public class ModelMPM extends ModelNPCMale{ // Updated False = 64x32 Skin // Steve 64x64 and Alex 64x64 - public ModelMPM(float par1, boolean updated, boolean arms) { + public ModelMPM(float par1, boolean arms) { - super(par1, updated, arms); + super(par1, arms); isArmor = par1 > 0; float par2 = 0; @@ -98,7 +98,6 @@ public class ModelMPM extends ModelNPCMale{ // this.bipedBodywear.setRotationPoint(0.0F, 0.0F + par2, 0.0F); // Steve 64x64 Model or Alex 64x64 Model - if (arms){ // Alex Version this.bipedRightArm = (new ModelScaleRenderer(this, 40, 16)); @@ -144,7 +143,6 @@ public class ModelMPM extends ModelNPCMale{ this.bipedRightLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, par1); this.bipedRightLeg.setRotationPoint(-1.9F, 12.0F + par2, 0.0F); - // Changed for 64x64 Texture this.bipedLeftLeg = new ModelScaleRenderer(this, 16, 48); this.bipedLeftLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, par1); this.bipedLeftLeg.setRotationPoint(1.9F, 12.0F + par2, 0.0F); diff --git a/src/main/java/noppes/npcs/client/model/ModelNPCMale.java b/src/main/java/noppes/npcs/client/model/ModelNPCMale.java index 73fd61442..dd9202135 100644 --- a/src/main/java/noppes/npcs/client/model/ModelNPCMale.java +++ b/src/main/java/noppes/npcs/client/model/ModelNPCMale.java @@ -18,31 +18,31 @@ public class ModelNPCMale extends ModelBiped { public boolean isDancing; public boolean isSleeping; - + public float animationTick; public float dancingTicks; public ModelNPCMale(float f) { - init(f, 0.0F); + init(f, 0.0F); } - public ModelNPCMale(float f, boolean updated, boolean arms) + public ModelNPCMale(float f, boolean arms) { super(f, 0.0F, 64, 64); - init(f, 0.0F, updated, arms); + init(f, 0.0F, arms); } @Override public void setLivingAnimations(EntityLivingBase par1EntityLiving, float f6, float f5, float par9){ - animationTick += par9; - dancingTicks = CustomNpcs.ticks / 3.978873F; + animationTick += par9; + dancingTicks = CustomNpcs.ticks / 3.978873F; } // 64x64 Skin - public void init(float f, float f1, boolean updated, boolean arms) + public void init(float f, float f1, boolean arms) { heldItemLeft = 0; @@ -72,57 +72,35 @@ public class ModelNPCMale extends ModelBiped bipedBody.addBox(-4F, 0.0F, -2F, 8, 12, 4, f); bipedBody.setRotationPoint(0.0F, 0.0F + f1, 0.0F); - if(updated){ - if (arms){ - // Alex Version - bipedRightArm = (new ModelScaleRenderer(this, 40, 16)); - bipedRightArm.addBox(-2.0F, -2.0F, -2.0F, 3, 12, 4, f); - bipedRightArm.setRotationPoint(-5.0F, 2.5F + f1, 0.0F); + if (arms){ + // Alex Version + bipedRightArm = (new ModelScaleRenderer(this, 40, 16)); + bipedRightArm.addBox(-2.0F, -2.0F, -2.0F, 3, 12, 4, f); + bipedRightArm.setRotationPoint(-5.0F, 2.5F + f1, 0.0F); - bipedLeftArm = new ModelScaleRenderer(this, 32, 48); - bipedLeftArm.addBox(-1.0F, -2.0F, -2.0F, 3, 12, 4, f); - bipedLeftArm.setRotationPoint(5.0F, 2.5F + f1, 0.0F); - } - else{ - // Steve Version - bipedRightArm = new ModelRenderer(this, 40, 16); - bipedRightArm.addBox(-3F, -2F, -2F, 4, 12, 4, f); - bipedRightArm.setRotationPoint(-5F, 2.0F + f1, 0.0F); - - bipedLeftArm = new ModelRenderer(this, 32, 48); - bipedLeftArm.addBox(-1.0F, -2.0F, -2.0F, 4, 12, 4, f); - bipedLeftArm.setRotationPoint(5.0F, 2.0F + f1, 0.0F); - } - - bipedRightLeg = new ModelRenderer(this, 0, 16); - bipedRightLeg.addBox(-2F, 0.0F, -2F, 4, 12, 4, f); - bipedRightLeg.setRotationPoint(-2F, 12F + f1, 0.0F); - - // 64x64 Leg Version - bipedLeftLeg = new ModelRenderer(this, 16, 48); - bipedLeftLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, f); - bipedLeftLeg.setRotationPoint(1.9F, 12.0F + f1, 0.0F); + bipedLeftArm = new ModelScaleRenderer(this, 32, 48); + bipedLeftArm.addBox(-1.0F, -2.0F, -2.0F, 3, 12, 4, f); + bipedLeftArm.setRotationPoint(5.0F, 2.5F + f1, 0.0F); } else{ + // Steve Version bipedRightArm = new ModelRenderer(this, 40, 16); bipedRightArm.addBox(-3F, -2F, -2F, 4, 12, 4, f); bipedRightArm.setRotationPoint(-5F, 2.0F + f1, 0.0F); - bipedLeftArm = new ModelRenderer(this, 40, 16); - bipedLeftArm.mirror = true; - bipedLeftArm.addBox(-1F, -2F, -2F, 4, 12, 4, f); - bipedLeftArm.setRotationPoint(5F, 2.0F + f1, 0.0F); - - bipedRightLeg = new ModelRenderer(this, 0, 16); - bipedRightLeg.addBox(-2F, 0.0F, -2F, 4, 12, 4, f); - bipedRightLeg.setRotationPoint(-2F, 12F + f1, 0.0F); - - bipedLeftLeg = new ModelRenderer(this, 0, 16); - bipedLeftLeg.mirror = true; - bipedLeftLeg.addBox(-2F, 0.0F, -2F, 4, 12, 4, f); - bipedLeftLeg.setRotationPoint(2.0F, 12F + f1, 0.0F); + bipedLeftArm = new ModelRenderer(this, 32, 48); + bipedLeftArm.addBox(-1.0F, -2.0F, -2.0F, 4, 12, 4, f); + bipedLeftArm.setRotationPoint(5.0F, 2.0F + f1, 0.0F); } + bipedRightLeg = new ModelRenderer(this, 0, 16); + bipedRightLeg.addBox(-2F, 0.0F, -2F, 4, 12, 4, f); + bipedRightLeg.setRotationPoint(-2F, 12F + f1, 0.0F); + + bipedLeftLeg = new ModelRenderer(this, 16, 48); + bipedLeftLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, f); + bipedLeftLeg.setRotationPoint(1.9F, 12.0F + f1, 0.0F); + } // 64x32 @@ -136,14 +114,14 @@ public class ModelNPCMale extends ModelBiped bipedCloak = new ModelRenderer(this, 0, 0); bipedCloak.textureHeight = 32; bipedCloak.addBox(-5F, 0.0F, -1F, 10, 16, 1, f); - + bipedEars = new ModelRenderer(this, 24, 0); bipedEars.addBox(-3F, -6F, -1F, 6, 6, 1, f); - + bipedHead = new ModelRenderer(this, 0, 0); bipedHead.addBox(-4F, -8F, -4F, 8, 8, 8, f); bipedHead.setRotationPoint(0.0F, 0.0F + f1, 0.0F); - + bipedHeadwear = new ModelRenderer(this, 32, 0); bipedHeadwear.addBox(-4F, -8F, -4F, 8, 8, 8, f + 0.5F); bipedHeadwear.setRotationPoint(0.0F, 0.0F + f1, 0.0F); @@ -164,7 +142,7 @@ public class ModelNPCMale extends ModelBiped bipedLeftLeg.mirror = true; bipedLeftLeg.addBox(-2F, 0.0F, -2F, 4, 12, 4, f); bipedLeftLeg.setRotationPoint(2.0F, 12F + f1, 0.0F); - + } @@ -174,85 +152,85 @@ public class ModelNPCMale extends ModelBiped public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7){ setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity); - if(!isDancing){ - bipedHead.render(par7); - bipedBody.render(par7); - bipedRightArm.render(par7); - bipedLeftArm.render(par7); - bipedRightLeg.render(par7); - bipedLeftLeg.render(par7); - bipedHeadwear.render(par7); - } - else{ - renderHead(par1Entity, par7); - renderArms(par1Entity, par7); - renderBody(par1Entity, par7); - renderLegs(par1Entity, par7); - } + if(!isDancing){ + bipedHead.render(par7); + bipedBody.render(par7); + bipedRightArm.render(par7); + bipedLeftArm.render(par7); + bipedRightLeg.render(par7); + bipedLeftLeg.render(par7); + bipedHeadwear.render(par7); + } + else{ + renderHead(par1Entity, par7); + renderArms(par1Entity, par7); + renderBody(par1Entity, par7); + renderLegs(par1Entity, par7); + } } public void renderHead(Entity entityliving,float par7){ - if(isDancing){ - GL11.glPushMatrix(); - GL11.glTranslatef((float)Math.sin(dancingTicks) * 0.075F, (float)Math.abs(Math.cos(dancingTicks)) * 0.125F - 0.02F, (float)(-Math.abs(Math.cos(dancingTicks))) * 0.075F); - bipedHead.render(par7); - bipedHeadwear.render(par7); - GL11.glPopMatrix(); - } - else{ - bipedHead.render(par7); - bipedHeadwear.render(par7); - } + if(isDancing){ + GL11.glPushMatrix(); + GL11.glTranslatef((float)Math.sin(dancingTicks) * 0.075F, (float)Math.abs(Math.cos(dancingTicks)) * 0.125F - 0.02F, (float)(-Math.abs(Math.cos(dancingTicks))) * 0.075F); + bipedHead.render(par7); + bipedHeadwear.render(par7); + GL11.glPopMatrix(); + } + else{ + bipedHead.render(par7); + bipedHeadwear.render(par7); + } } public void renderLeftArm(Entity entityliving,float par7){ - if(isDancing){ - GL11.glPushMatrix(); - GL11.glTranslatef((float)Math.sin(dancingTicks) * 0.025F, (float)Math.abs(Math.cos(dancingTicks)) * 0.125F - 0.02F, 0.0F); - bipedLeftArm.render(par7); - GL11.glPopMatrix(); - } - else{ - bipedLeftArm.render(par7); - } + if(isDancing){ + GL11.glPushMatrix(); + GL11.glTranslatef((float)Math.sin(dancingTicks) * 0.025F, (float)Math.abs(Math.cos(dancingTicks)) * 0.125F - 0.02F, 0.0F); + bipedLeftArm.render(par7); + GL11.glPopMatrix(); + } + else{ + bipedLeftArm.render(par7); + } } public void renderArms(Entity entity,float par7){ - renderLeftArm(entity,par7); - renderRightArm(entity,par7); + renderLeftArm(entity,par7); + renderRightArm(entity,par7); } public void renderRightArm(Entity entityliving,float par7){ - if(isDancing){ - GL11.glPushMatrix(); - GL11.glTranslatef((float)Math.sin(dancingTicks) * 0.025F, (float)Math.abs(Math.cos(dancingTicks)) * 0.125F - 0.02F, 0.0F); - bipedRightArm.render(par7); - GL11.glPopMatrix(); - } - else{ - bipedRightArm.render(par7); - } + if(isDancing){ + GL11.glPushMatrix(); + GL11.glTranslatef((float)Math.sin(dancingTicks) * 0.025F, (float)Math.abs(Math.cos(dancingTicks)) * 0.125F - 0.02F, 0.0F); + bipedRightArm.render(par7); + GL11.glPopMatrix(); + } + else{ + bipedRightArm.render(par7); + } } public void renderBody(Entity entityliving,float par7){ - if(isDancing){ - GL11.glPushMatrix(); - GL11.glTranslatef((float)Math.sin(dancingTicks) * 0.015F, 0.0F, 0.0F); - bipedBody.render(par7); - GL11.glPopMatrix(); - } - else{ - bipedBody.render(par7); - } + if(isDancing){ + GL11.glPushMatrix(); + GL11.glTranslatef((float)Math.sin(dancingTicks) * 0.015F, 0.0F, 0.0F); + bipedBody.render(par7); + GL11.glPopMatrix(); + } + else{ + bipedBody.render(par7); + } } public void renderLegs(Entity entityliving,float par7){ bipedRightLeg.render(par7); bipedLeftLeg.render(par7); } - + public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity entity) { - EntityNPCInterface npc = (EntityNPCInterface) entity; - isRiding = npc.isRiding(); - - - if(isSneak && (npc.currentAnimation == EnumAnimation.CRAWLING || npc.currentAnimation == EnumAnimation.LYING)) - isSneak = false; + EntityNPCInterface npc = (EntityNPCInterface) entity; + isRiding = npc.isRiding(); + + + if(isSneak && (npc.currentAnimation == EnumAnimation.CRAWLING || npc.currentAnimation == EnumAnimation.LYING)) + isSneak = false; bipedHead.rotateAngleY = par4 / (180F / (float)Math.PI); bipedHead.rotateAngleX = par5 / (180F / (float)Math.PI); bipedHeadwear.rotateAngleY = bipedHead.rotateAngleY; @@ -265,7 +243,7 @@ public class ModelNPCMale extends ModelBiped bipedLeftLeg.rotateAngleX = MathHelper.cos(par1 * 0.6662F + (float)Math.PI) * 1.4F * par2; bipedRightLeg.rotateAngleY = 0.0F; bipedLeftLeg.rotateAngleY = 0.0F; - + if (isRiding) { bipedRightArm.rotateAngleX += -((float)Math.PI / 5F); @@ -369,19 +347,19 @@ public class ModelNPCMale extends ModelBiped public void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; } - + public void renderCloak(float f) { bipedCloak.render(f); } - public boolean isSleeping(Entity entity) { - if(entity instanceof EntityPlayer && ((EntityPlayer)entity).isPlayerSleeping()) - return true; - return ((EntityNPCInterface)entity).currentAnimation == EnumAnimation.LYING; - } + public boolean isSleeping(Entity entity) { + if(entity instanceof EntityPlayer && ((EntityPlayer)entity).isPlayerSleeping()) + return true; + return ((EntityNPCInterface)entity).currentAnimation == EnumAnimation.LYING; + } } diff --git a/src/main/java/noppes/npcs/client/renderer/RenderNPCHumanMale.java b/src/main/java/noppes/npcs/client/renderer/RenderNPCHumanMale.java index 1675cd566..22fa8bc54 100644 --- a/src/main/java/noppes/npcs/client/renderer/RenderNPCHumanMale.java +++ b/src/main/java/noppes/npcs/client/renderer/RenderNPCHumanMale.java @@ -41,13 +41,13 @@ public class RenderNPCHumanMale extends RenderNPCInterface protected final ModelNPCMale OGmodelArmorChestplate = new ModelMPM(1); protected final ModelNPCMale OGmodelArmor = new ModelMPM(0.5f); - protected final ModelMPM steve = new ModelMPM(0, true, false); - protected final ModelMPM steveArmorChestplate = new ModelMPM(1, true, false); - protected final ModelMPM steveModelArmor = new ModelMPM(0.5f, true, false); + protected final ModelMPM steve = new ModelMPM(0, false); + protected final ModelMPM steveArmorChestplate = new ModelMPM(1, false); + protected final ModelMPM steveModelArmor = new ModelMPM(0.5f, false); - protected final ModelMPM alex = new ModelMPM(0, true, true); - protected final ModelMPM alexArmorChestplate = new ModelMPM(1, true, true); - protected final ModelMPM alexModelArmor = new ModelMPM(0.5f, true, true); + protected final ModelMPM alex = new ModelMPM(0, true); + protected final ModelMPM alexArmorChestplate = new ModelMPM(1, true); + protected final ModelMPM alexModelArmor = new ModelMPM(0.5f, true); public RenderNPCHumanMale(ModelNPCMale mainmodel, ModelNPCMale armorChest, ModelNPCMale armor) {