mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-16 22:15:06 +00:00
Big Changes to ModelMPM for 1.8 Layers
> Added all 2D Layers to Models > Moved Texture Location for PartData to remove texture syncing between MorePlayerModels and CustomNPC. > Attempted first start at Bodywear 3D model similar to Headwear 3D model.
This commit is contained in:
1 parent
be2f32a97f
commit
8a4be0bc1e
68 files changed
+476
-219
No files matched your search
@@ -14,26 +14,13 @@ import noppes.npcs.ModelPartData;
|
||||
import noppes.npcs.client.ClientProxy;
|
||||
import noppes.npcs.client.model.animation.AniCrawling;
|
||||
import noppes.npcs.client.model.animation.AniHug;
|
||||
import noppes.npcs.client.model.part.ModelBeard;
|
||||
import noppes.npcs.client.model.part.ModelBreasts;
|
||||
import noppes.npcs.client.model.part.ModelClaws;
|
||||
import noppes.npcs.client.model.part.ModelEars;
|
||||
import noppes.npcs.client.model.part.ModelFin;
|
||||
import noppes.npcs.client.model.part.ModelHair;
|
||||
import noppes.npcs.client.model.part.ModelHeadwear;
|
||||
import noppes.npcs.client.model.part.ModelLegs;
|
||||
import noppes.npcs.client.model.part.ModelMohawk;
|
||||
import noppes.npcs.client.model.part.ModelSnout;
|
||||
import noppes.npcs.client.model.part.ModelTail;
|
||||
import noppes.npcs.client.model.part.ModelWings;
|
||||
import noppes.npcs.client.model.part.*;
|
||||
import noppes.npcs.client.model.util.ModelPartInterface;
|
||||
import noppes.npcs.client.model.util.ModelScaleRenderer;
|
||||
import noppes.npcs.constants.EnumAnimation;
|
||||
import noppes.npcs.constants.EnumJobType;
|
||||
import noppes.npcs.entity.EntityCustomNpc;
|
||||
import noppes.npcs.roles.JobPuppet;
|
||||
import noppes.npcs.client.model.part.ModelHorns;
|
||||
import noppes.npcs.client.model.part.ModelSkirt;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
@@ -46,27 +33,39 @@ public class ModelMPM extends ModelNPCMale{
|
||||
private ModelPartInterface snout;
|
||||
private ModelPartInterface ears;
|
||||
private ModelPartInterface fin;
|
||||
private ModelPartInterface skirt;
|
||||
private ModelPartInterface skirt;
|
||||
private ModelPartInterface horns;
|
||||
|
||||
private ModelPartInterface clawsR;
|
||||
private ModelPartInterface clawsL;
|
||||
|
||||
|
||||
// New
|
||||
public ModelRenderer bipedBodywear;
|
||||
public ModelRenderer bipedRightArmwear;
|
||||
public ModelRenderer bipedLeftArmwear;
|
||||
public ModelRenderer bipedRightLegWear;
|
||||
public ModelRenderer bipedLeftLegWear;
|
||||
|
||||
private ModelLegs legs;
|
||||
private ModelScaleRenderer headwear;
|
||||
|
||||
// private ModelScaleRenderer bodywear;
|
||||
// private ModelScaleRenderer armwear;
|
||||
// private ModelScaleRenderer legwear;
|
||||
|
||||
private ModelTail tail;
|
||||
public ModelBase entityModel;
|
||||
public EntityLivingBase entity;
|
||||
|
||||
|
||||
public boolean currentlyPlayerTexture;
|
||||
|
||||
|
||||
public boolean isArmor;
|
||||
public float alpha = 1;
|
||||
|
||||
// Check Legacy Code for Old Version
|
||||
|
||||
// Updated False = 64x32 Skin
|
||||
// Steve 64x64 and Alex 64x64
|
||||
// Updated False = 64x32 Skin
|
||||
// Steve 64x64 and Alex 64x64
|
||||
public ModelMPM(float par1, boolean updated, boolean arms) {
|
||||
|
||||
super(par1, updated, arms);
|
||||
@@ -91,17 +90,34 @@ public class ModelMPM extends ModelNPCMale{
|
||||
this.bipedBody.addBox(-4.0F, 0.0F, -2.0F, 8, 12, 4, par1);
|
||||
this.bipedBody.setRotationPoint(0.0F, 0.0F + par2, 0.0F);
|
||||
|
||||
// New Extension
|
||||
this.bipedBodywear = (new ModelScaleRenderer(this, 16, 32));
|
||||
this.bipedBodywear.addBox(-4.0F, 0.0F, -2.0F, 8, 12, 4, par1 + 0.5F);
|
||||
this.bipedBody.addChild(this.bipedBodywear);
|
||||
// this.bipedBodywear.setRotationPoint(0.0F, 0.0F + par2, 0.0F);
|
||||
|
||||
// Steve 64x64 Model or Alex 64x64 Model
|
||||
if(updated){
|
||||
|
||||
if (arms){
|
||||
// Alex Version
|
||||
this.bipedRightArm = (new ModelScaleRenderer(this, 40, 16));
|
||||
this.bipedRightArm.addBox(-2.0F, -2.0F, -2.0F, 3, 12, 4, par1);
|
||||
this.bipedRightArm.setRotationPoint(-5.0F, 2.5F + par2, 0.0F);
|
||||
// this.bipedRightArm.setRotationPoint(-5.0F, 2.5F + par2, 0.0F);
|
||||
|
||||
this.bipedLeftArm = new ModelScaleRenderer(this, 32, 48);
|
||||
this.bipedLeftArm.addBox(-1.0F, -2.0F, -2.0F, 3, 12, 4, par1);
|
||||
this.bipedLeftArm.setRotationPoint(5.0F, 2.5F + par2, 0.0F);
|
||||
|
||||
this.bipedRightArmwear = (new ModelScaleRenderer(this, 40, 32));
|
||||
this.bipedRightArmwear.addBox(-2.0F, -2.0F, -2.0F, 3, 12, 4, par1 + 0.25F);
|
||||
this.bipedRightArm.addChild(this.bipedRightArmwear);
|
||||
// this.bipedRightArmWear.setRotationPoint(-5.0F, 2.5F + par2, 0.0F);
|
||||
|
||||
this.bipedLeftArmwear = new ModelScaleRenderer(this, 48, 48);
|
||||
this.bipedLeftArmwear.addBox(-1.0F, -2.0F, -2.0F, 3, 12, 4, par1 + 0.25F);
|
||||
this.bipedLeftArm.addChild(this.bipedLeftArmwear);
|
||||
// this.bipedLeftArmWear.setRotationPoint(5.0F, 2.5F + par2, 0.0F);
|
||||
}
|
||||
else{
|
||||
// Steve Version
|
||||
@@ -112,6 +128,16 @@ public class ModelMPM extends ModelNPCMale{
|
||||
this.bipedLeftArm = new ModelScaleRenderer(this, 32, 48);
|
||||
this.bipedLeftArm.addBox(-1.0F, -2.0F, -2.0F, 4, 12, 4, par1);
|
||||
this.bipedLeftArm.setRotationPoint(5.0F, 2.0F + par2, 0.0F);
|
||||
|
||||
this.bipedRightArmwear = (new ModelScaleRenderer(this, 40, 32));
|
||||
this.bipedRightArmwear.addBox(-3.0F, -2.0F, -2.0F, 4, 12, 4, par1 + 0.25F);
|
||||
this.bipedRightArm.addChild(this.bipedRightArmwear);
|
||||
//this.bipedRightArmWear.setRotationPoint(-5.0F, 2.0F + par2, 0.0F);
|
||||
|
||||
this.bipedLeftArmwear = new ModelScaleRenderer(this, 48, 48);
|
||||
this.bipedLeftArmwear.addBox(-1.0F, -2.0F, -2.0F, 4, 12, 4, par1 + 0.25F);
|
||||
this.bipedLeftArm.addChild(this.bipedLeftArmwear);
|
||||
//this.bipedLeftArmWear.setRotationPoint(5.0F, 2.0F + par2, 0.0F);
|
||||
}
|
||||
|
||||
this.bipedRightLeg = (new ModelScaleRenderer(this, 0, 16));
|
||||
@@ -122,6 +148,17 @@ public class ModelMPM extends ModelNPCMale{
|
||||
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);
|
||||
|
||||
this.bipedRightLegWear = (new ModelScaleRenderer(this, 0, 32));
|
||||
this.bipedRightLegWear.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, par1 + 0.25F);
|
||||
this.bipedRightLeg.addChild(this.bipedRightLegWear);
|
||||
// this.bipedRightLegWear.setRotationPoint(-1.9F, 12.0F + par2, 0.0F);
|
||||
|
||||
this.bipedLeftLegWear = new ModelScaleRenderer(this, 0, 48);
|
||||
this.bipedLeftLegWear.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, par1 + 0.25F);
|
||||
this.bipedLeftLeg.addChild(this.bipedLeftLegWear);
|
||||
// this.bipedLeftLegWear.setRotationPoint(1.9F, 12.0F + par2, 0.0F);
|
||||
|
||||
}
|
||||
// Steve 64x32 Model
|
||||
else{
|
||||
@@ -135,18 +172,43 @@ public class ModelMPM extends ModelNPCMale{
|
||||
this.bipedLeftArm.addBox(-1.0F, -2.0F, -2.0F, 4, 12, 4, par1);
|
||||
this.bipedLeftArm.setRotationPoint(5.0F, 2.0F + par2, 0.0F);
|
||||
|
||||
// Arms
|
||||
this.bipedRightArmwear = (new ModelScaleRenderer(this, 40, 16));
|
||||
this.bipedRightArmwear.addBox(-3.0F, -2.0F, -2.0F, 4, 12, 4, par1 + 0.25F);
|
||||
this.bipedRightArm.addChild(this.bipedRightArmwear);
|
||||
//this.bipedRightArmWear.setRotationPoint(-5.0F, 2.0F + par2, 0.0F);
|
||||
|
||||
this.bipedLeftArmwear = new ModelScaleRenderer(this, 40, 16);
|
||||
this.bipedLeftArmwear.mirror = true;
|
||||
this.bipedLeftArmwear.addBox(-1.0F, -2.0F, -2.0F, 4, 12, 4, par1 + 0.25F);
|
||||
this.bipedLeftArm.addChild(this.bipedLeftArmwear);
|
||||
//this.bipedLeftArmWear.setRotationPoint(5.0F, 2.0F + par2, 0.0F);
|
||||
|
||||
this.bipedRightLeg = new ModelScaleRenderer(this, 0, 16);
|
||||
this.bipedRightLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, par1);
|
||||
this.bipedRightLeg.setRotationPoint(-1.9F, 12.0F + par2, 0.0F);
|
||||
this.bipedLeftLeg = new ModelScaleRenderer(this, 0, 16);
|
||||
|
||||
this.bipedLeftLeg = new ModelScaleRenderer(this, 0, 16);
|
||||
this.bipedLeftLeg.mirror = true;
|
||||
this.bipedLeftLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, par1);
|
||||
this.bipedLeftLeg.setRotationPoint(1.9F, 12.0F + par2, 0.0F);
|
||||
|
||||
this.bipedRightLegWear = (new ModelScaleRenderer(this, 0, 16));
|
||||
this.bipedRightLegWear.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, par1 + 0.25F);
|
||||
this.bipedRightLeg.addChild(this.bipedRightLegWear);
|
||||
// this.bipedRightLegWear.setRotationPoint(-1.9F, 12.0F + par2, 0.0F);
|
||||
|
||||
this.bipedLeftLegWear = new ModelScaleRenderer(this, 0, 16);
|
||||
this.bipedLeftArmwear.mirror = true;
|
||||
this.bipedLeftLegWear.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, par1 + 0.25F);
|
||||
this.bipedLeftLeg.addChild(this.bipedLeftLegWear);
|
||||
// this.bipedLeftLegWear.setRotationPoint(1.9F, 12.0F + par2, 0.0F);
|
||||
|
||||
}
|
||||
|
||||
headwear = new ModelHeadwear(this);
|
||||
legs = new ModelLegs(this, (ModelScaleRenderer)bipedRightLeg, (ModelScaleRenderer)bipedLeftLeg);
|
||||
// bodywear = new ModelBodywear(this);
|
||||
|
||||
this.bipedBody.addChild(breasts = new ModelBreasts(this));
|
||||
if(!isArmor){
|
||||
@@ -171,7 +233,7 @@ public class ModelMPM extends ModelNPCMale{
|
||||
this.bipedRightArm.addChild(clawsR = new ModelClaws(this, true));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void setPlayerData(EntityCustomNpc entity){
|
||||
if(!isArmor){
|
||||
mohawk.setData(entity.modelData, entity);
|
||||
@@ -184,17 +246,17 @@ public class ModelMPM extends ModelNPCMale{
|
||||
ears.setData(entity.modelData, entity);
|
||||
clawsL.setData(entity.modelData, entity);
|
||||
clawsR.setData(entity.modelData, entity);
|
||||
skirt.setData(entity.modelData, entity);
|
||||
horns.setData(entity.modelData, entity);
|
||||
skirt.setData(entity.modelData, entity);
|
||||
horns.setData(entity.modelData, entity);
|
||||
}
|
||||
breasts.setData(entity.modelData, entity);
|
||||
legs.setData(entity);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7){
|
||||
EntityCustomNpc npc = (EntityCustomNpc) par1Entity;
|
||||
|
||||
|
||||
@Override
|
||||
public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7){
|
||||
EntityCustomNpc npc = (EntityCustomNpc) par1Entity;
|
||||
|
||||
if(entityModel != null){
|
||||
if(!isArmor){
|
||||
@@ -213,151 +275,185 @@ public class ModelMPM extends ModelNPCMale{
|
||||
}
|
||||
else{
|
||||
alpha = npc.isInvisible() && !npc.isInvisibleToPlayer(Minecraft.getMinecraft().thePlayer)?0.15f:1;
|
||||
setPlayerData(npc);
|
||||
currentlyPlayerTexture = true;
|
||||
setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity);
|
||||
if(npc.advanced.job == EnumJobType.Puppet){
|
||||
JobPuppet job = (JobPuppet) npc.jobInterface;
|
||||
if(job.isActive()){
|
||||
float pi = (float) Math.PI;
|
||||
|
||||
if(!job.head.disabled){
|
||||
bipedHeadwear.rotateAngleX = bipedHead.rotateAngleX = job.head.rotationX * pi;
|
||||
bipedHeadwear.rotateAngleY = bipedHead.rotateAngleY = job.head.rotationY * pi;
|
||||
bipedHeadwear.rotateAngleZ = bipedHead.rotateAngleZ = job.head.rotationZ * pi;
|
||||
}
|
||||
setPlayerData(npc);
|
||||
currentlyPlayerTexture = true;
|
||||
setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity);
|
||||
if(npc.advanced.job == EnumJobType.Puppet){
|
||||
JobPuppet job = (JobPuppet) npc.jobInterface;
|
||||
if(job.isActive()){
|
||||
float pi = (float) Math.PI;
|
||||
|
||||
if(!job.body.disabled){
|
||||
bipedBody.rotateAngleX = job.body.rotationX * pi;
|
||||
bipedBody.rotateAngleY = job.body.rotationY * pi;
|
||||
bipedBody.rotateAngleZ = job.body.rotationZ * pi;
|
||||
}
|
||||
if(!job.head.disabled){
|
||||
bipedHeadwear.rotateAngleX = bipedHead.rotateAngleX = job.head.rotationX * pi;
|
||||
bipedHeadwear.rotateAngleY = bipedHead.rotateAngleY = job.head.rotationY * pi;
|
||||
bipedHeadwear.rotateAngleZ = bipedHead.rotateAngleZ = job.head.rotationZ * pi;
|
||||
}
|
||||
|
||||
if(!job.larm.disabled){
|
||||
bipedLeftArm.rotateAngleX = job.larm.rotationX * pi;
|
||||
bipedLeftArm.rotateAngleY = job.larm.rotationY * pi;
|
||||
bipedLeftArm.rotateAngleZ = job.larm.rotationZ * pi;
|
||||
|
||||
if(!npc.display.disableLivingAnimation){
|
||||
this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(par3 * 0.09F) * 0.05F + 0.05F;
|
||||
this.bipedLeftArm.rotateAngleX -= MathHelper.sin(par3 * 0.067F) * 0.05F;
|
||||
}
|
||||
}
|
||||
if(!job.body.disabled){
|
||||
bipedBody.rotateAngleX = job.body.rotationX * pi;
|
||||
bipedBody.rotateAngleY = job.body.rotationY * pi;
|
||||
bipedBody.rotateAngleZ = job.body.rotationZ * pi;
|
||||
}
|
||||
|
||||
if(!job.rarm.disabled){
|
||||
bipedRightArm.rotateAngleX = job.rarm.rotationX * pi;
|
||||
bipedRightArm.rotateAngleY = job.rarm.rotationY * pi;
|
||||
bipedRightArm.rotateAngleZ = job.rarm.rotationZ * pi;
|
||||
if(!job.larm.disabled){
|
||||
bipedLeftArm.rotateAngleX = job.larm.rotationX * pi;
|
||||
bipedLeftArm.rotateAngleY = job.larm.rotationY * pi;
|
||||
bipedLeftArm.rotateAngleZ = job.larm.rotationZ * pi;
|
||||
|
||||
if(!npc.display.disableLivingAnimation){
|
||||
this.bipedRightArm.rotateAngleZ += MathHelper.cos(par3 * 0.09F) * 0.05F + 0.05F;
|
||||
this.bipedRightArm.rotateAngleX += MathHelper.sin(par3 * 0.067F) * 0.05F;
|
||||
}
|
||||
}
|
||||
if(!npc.display.disableLivingAnimation){
|
||||
this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(par3 * 0.09F) * 0.05F + 0.05F;
|
||||
this.bipedLeftArm.rotateAngleX -= MathHelper.sin(par3 * 0.067F) * 0.05F;
|
||||
}
|
||||
}
|
||||
|
||||
if(!job.rleg.disabled){
|
||||
bipedRightLeg.rotateAngleX = job.rleg.rotationX * pi;
|
||||
bipedRightLeg.rotateAngleY = job.rleg.rotationY * pi;
|
||||
bipedRightLeg.rotateAngleZ = job.rleg.rotationZ * pi;
|
||||
}
|
||||
if(!job.rarm.disabled){
|
||||
bipedRightArm.rotateAngleX = job.rarm.rotationX * pi;
|
||||
bipedRightArm.rotateAngleY = job.rarm.rotationY * pi;
|
||||
bipedRightArm.rotateAngleZ = job.rarm.rotationZ * pi;
|
||||
|
||||
if(!job.lleg.disabled){
|
||||
bipedLeftLeg.rotateAngleX = job.lleg.rotationX * pi;
|
||||
bipedLeftLeg.rotateAngleY = job.lleg.rotationY * pi;
|
||||
bipedLeftLeg.rotateAngleZ = job.lleg.rotationZ * pi;
|
||||
}
|
||||
}
|
||||
}
|
||||
renderHead(npc, par7);
|
||||
renderArms(npc, par7,false);
|
||||
renderBody(npc, par7);
|
||||
renderLegs(npc, par7);
|
||||
if(!npc.display.disableLivingAnimation){
|
||||
this.bipedRightArm.rotateAngleZ += MathHelper.cos(par3 * 0.09F) * 0.05F + 0.05F;
|
||||
this.bipedRightArm.rotateAngleX += MathHelper.sin(par3 * 0.067F) * 0.05F;
|
||||
}
|
||||
}
|
||||
|
||||
if(!job.rleg.disabled){
|
||||
bipedRightLeg.rotateAngleX = job.rleg.rotationX * pi;
|
||||
bipedRightLeg.rotateAngleY = job.rleg.rotationY * pi;
|
||||
bipedRightLeg.rotateAngleZ = job.rleg.rotationZ * pi;
|
||||
}
|
||||
|
||||
if(!job.lleg.disabled){
|
||||
bipedLeftLeg.rotateAngleX = job.lleg.rotationX * pi;
|
||||
bipedLeftLeg.rotateAngleY = job.lleg.rotationY * pi;
|
||||
bipedLeftLeg.rotateAngleZ = job.lleg.rotationZ * pi;
|
||||
}
|
||||
}
|
||||
}
|
||||
renderHead(npc, par7);
|
||||
renderArms(npc, par7,false);
|
||||
renderBody(npc, par7);
|
||||
renderLegs(npc, par7);
|
||||
}
|
||||
|
||||
}
|
||||
@Override
|
||||
public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity entity)
|
||||
{
|
||||
EntityCustomNpc npc = (EntityCustomNpc) entity;
|
||||
|
||||
}
|
||||
@Override
|
||||
public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity entity)
|
||||
{
|
||||
EntityCustomNpc npc = (EntityCustomNpc) entity;
|
||||
isRiding = npc.isRiding();
|
||||
if(isSneak && (npc.currentAnimation == EnumAnimation.CRAWLING || npc.currentAnimation == EnumAnimation.LYING))
|
||||
isSneak = false;
|
||||
this.bipedBody.rotationPointX = 0;
|
||||
this.bipedBody.rotationPointY = 0;
|
||||
this.bipedBody.rotationPointZ = 0;
|
||||
if(isSneak && (npc.currentAnimation == EnumAnimation.CRAWLING || npc.currentAnimation == EnumAnimation.LYING))
|
||||
isSneak = false;
|
||||
|
||||
// Body Rotations
|
||||
this.bipedBody.rotationPointX = 0;
|
||||
this.bipedBody.rotationPointY = 0;
|
||||
this.bipedBody.rotationPointZ = 0;
|
||||
this.bipedBody.rotateAngleX = 0;
|
||||
this.bipedBody.rotateAngleY = 0;
|
||||
this.bipedBody.rotateAngleZ = 0;
|
||||
|
||||
this.bipedBodywear.rotationPointX = 0;
|
||||
this.bipedBodywear.rotationPointY = 0;
|
||||
this.bipedBodywear.rotationPointZ = 0;
|
||||
this.bipedBodywear.rotateAngleX = 0;
|
||||
this.bipedBodywear.rotateAngleY = 0;
|
||||
this.bipedBodywear.rotateAngleZ = 0;
|
||||
|
||||
// Head Rotations
|
||||
this.bipedHead.rotateAngleZ = 0;
|
||||
this.bipedHeadwear.rotateAngleZ = 0;
|
||||
|
||||
// Leg Rotations
|
||||
this.bipedLeftLeg.rotateAngleX = 0;
|
||||
this.bipedLeftLeg.rotateAngleY = 0;
|
||||
this.bipedLeftLeg.rotateAngleZ = 0;
|
||||
|
||||
this.bipedLeftLegWear.rotateAngleX = 0;
|
||||
this.bipedLeftLegWear.rotateAngleY = 0;
|
||||
this.bipedLeftLegWear.rotateAngleZ = 0;
|
||||
|
||||
this.bipedRightLeg.rotateAngleX = 0;
|
||||
this.bipedRightLeg.rotateAngleY = 0;
|
||||
this.bipedRightLeg.rotateAngleZ = 0;
|
||||
|
||||
this.bipedRightLegWear.rotateAngleX = 0;
|
||||
this.bipedRightLegWear.rotateAngleY = 0;
|
||||
this.bipedRightLegWear.rotateAngleZ = 0;
|
||||
|
||||
// Arm Rotations
|
||||
this.bipedLeftArm.rotationPointY = 2;
|
||||
this.bipedLeftArm.rotationPointZ = 0;
|
||||
|
||||
this.bipedLeftArmwear.rotationPointY = 2;
|
||||
this.bipedLeftArmwear.rotationPointZ = 0;
|
||||
|
||||
this.bipedRightArm.rotationPointY = 2;
|
||||
this.bipedRightArm.rotationPointZ = 0;
|
||||
|
||||
super.setRotationAngles(par1, par2, par3, par4, par5, par6, entity);
|
||||
|
||||
this.bipedRightArmwear.rotationPointY = 2;
|
||||
this.bipedRightArmwear.rotationPointZ = 0;
|
||||
|
||||
super.setRotationAngles(par1, par2, par3, par4, par5, par6, entity);
|
||||
|
||||
if(!isArmor){
|
||||
hair.setRotationAngles(par1, par2, par3, par4, par5, par6, entity);
|
||||
beard.setRotationAngles(par1, par2, par3, par4, par5, par6, entity);
|
||||
wings.setRotationAngles(par1, par2, par3, par4, par5, par6, entity);
|
||||
tail.setRotationAngles(par1, par2, par3, par4, par5, par6, entity);
|
||||
skirt.setRotationAngles(par1, par2, par3, par4, par5, par6, entity);
|
||||
hair.setRotationAngles(par1, par2, par3, par4, par5, par6, entity);
|
||||
beard.setRotationAngles(par1, par2, par3, par4, par5, par6, entity);
|
||||
wings.setRotationAngles(par1, par2, par3, par4, par5, par6, entity);
|
||||
tail.setRotationAngles(par1, par2, par3, par4, par5, par6, entity);
|
||||
skirt.setRotationAngles(par1, par2, par3, par4, par5, par6, entity);
|
||||
}
|
||||
legs.setRotationAngles(par1, par2, par3, par4, par5, par6, entity);
|
||||
|
||||
if(isSleeping(entity)){
|
||||
if(bipedHead.rotateAngleX < 0){
|
||||
bipedHead.rotateAngleX = 0;
|
||||
bipedHeadwear.rotateAngleX = 0;
|
||||
}
|
||||
}
|
||||
else if(npc.currentAnimation == EnumAnimation.CRY)
|
||||
bipedHeadwear.rotateAngleX = bipedHead.rotateAngleX = 0.7f;
|
||||
else if(npc.currentAnimation == EnumAnimation.HUG){
|
||||
AniHug.setRotationAngles(par1, par2, par3, par4, par5, par6, entity, this);
|
||||
}
|
||||
else if(npc.currentAnimation == EnumAnimation.CRAWLING)
|
||||
AniCrawling.setRotationAngles(par1, par2, par3, par4, par5, par6, entity, this);
|
||||
else if(npc.currentAnimation == EnumAnimation.WAVING){
|
||||
bipedRightArm.rotateAngleX = -0.1f;
|
||||
bipedRightArm.rotateAngleY = 0;
|
||||
bipedRightArm.rotateAngleZ = (float) (Math.PI - 1f - Math.sin(entity.ticksExisted * 0.27f) * 0.5f );
|
||||
}
|
||||
else if(isSneak)
|
||||
this.bipedBody.rotateAngleX = 0.5F / npc.modelData.body.scaleY;
|
||||
|
||||
|
||||
}
|
||||
legs.setRotationAngles(par1, par2, par3, par4, par5, par6, entity);
|
||||
|
||||
public void setLivingAnimations(EntityLivingBase par1EntityLivingBase, float par2, float par3, float par4)
|
||||
{
|
||||
if(isSleeping(entity)){
|
||||
if(bipedHead.rotateAngleX < 0){
|
||||
bipedHead.rotateAngleX = 0;
|
||||
bipedHeadwear.rotateAngleX = 0;
|
||||
}
|
||||
}
|
||||
else if(npc.currentAnimation == EnumAnimation.CRY)
|
||||
bipedHeadwear.rotateAngleX = bipedHead.rotateAngleX = 0.7f;
|
||||
|
||||
else if(npc.currentAnimation == EnumAnimation.HUG){
|
||||
AniHug.setRotationAngles(par1, par2, par3, par4, par5, par6, entity, this);
|
||||
}
|
||||
|
||||
else if(npc.currentAnimation == EnumAnimation.CRAWLING)
|
||||
AniCrawling.setRotationAngles(par1, par2, par3, par4, par5, par6, entity, this);
|
||||
|
||||
else if(npc.currentAnimation == EnumAnimation.WAVING){
|
||||
bipedRightArm.rotateAngleX = -0.1f;
|
||||
bipedRightArm.rotateAngleY = 0;
|
||||
bipedRightArm.rotateAngleZ = (float) (Math.PI - 1f - Math.sin(entity.ticksExisted * 0.27f) * 0.5f );
|
||||
}
|
||||
else if(isSneak){
|
||||
this.bipedBody.rotateAngleX = 0.5F / npc.modelData.body.scaleY;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void setLivingAnimations(EntityLivingBase par1EntityLivingBase, float par2, float par3, float par4)
|
||||
{
|
||||
if(entityModel != null){
|
||||
entityModel.setLivingAnimations(entity, par2, par3, par4);
|
||||
}
|
||||
else{
|
||||
EntityCustomNpc npc = (EntityCustomNpc) par1EntityLivingBase;
|
||||
EntityCustomNpc npc = (EntityCustomNpc) par1EntityLivingBase;
|
||||
if(!isArmor){
|
||||
ModelPartData partData = npc.modelData.getPartData("tail");
|
||||
if(partData != null)
|
||||
tail.setLivingAnimations(partData, par1EntityLivingBase, par2, par3, par4);
|
||||
ModelPartData partData = npc.modelData.getPartData("tail");
|
||||
if(partData != null)
|
||||
tail.setLivingAnimations(partData, par1EntityLivingBase, par2, par3, par4);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void loadPlayerTexture(EntityCustomNpc npc){
|
||||
public void loadPlayerTexture(EntityCustomNpc npc){
|
||||
if(!isArmor && !currentlyPlayerTexture){
|
||||
ClientProxy.bindTexture(npc.textureLocation);
|
||||
currentlyPlayerTexture = true;
|
||||
ClientProxy.bindTexture(npc.textureLocation);
|
||||
currentlyPlayerTexture = true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void renderHead(EntityCustomNpc entity, float f) {
|
||||
loadPlayerTexture(entity);
|
||||
float x = 0;
|
||||
@@ -365,10 +461,10 @@ public class ModelMPM extends ModelNPCMale{
|
||||
float z = 0;
|
||||
|
||||
GL11.glPushMatrix();
|
||||
if(entity.currentAnimation == EnumAnimation.DANCING){
|
||||
float dancing = entity.ticksExisted / 4f;
|
||||
GL11.glTranslatef((float)Math.sin(dancing) * 0.075F, (float)Math.abs(Math.cos(dancing)) * 0.125F - 0.02F, (float)(-Math.abs(Math.cos(dancing))) * 0.075F);
|
||||
}
|
||||
if(entity.currentAnimation == EnumAnimation.DANCING){
|
||||
float dancing = entity.ticksExisted / 4f;
|
||||
GL11.glTranslatef((float)Math.sin(dancing) * 0.075F, (float)Math.abs(Math.cos(dancing)) * 0.125F - 0.02F, (float)(-Math.abs(Math.cos(dancing))) * 0.075F);
|
||||
}
|
||||
ModelPartConfig head = entity.modelData.head;
|
||||
if(bipedHeadwear.showModel && !bipedHeadwear.isHidden){
|
||||
if(entity.modelData.headwear == 1 || isArmor){
|
||||
@@ -391,7 +487,7 @@ public class ModelMPM extends ModelNPCMale{
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
|
||||
private void renderBody(EntityCustomNpc entity, float f) {
|
||||
loadPlayerTexture(entity);
|
||||
float x = 0;
|
||||
@@ -399,16 +495,38 @@ public class ModelMPM extends ModelNPCMale{
|
||||
float z = 0;
|
||||
GL11.glPushMatrix();
|
||||
|
||||
if(entity.currentAnimation == EnumAnimation.DANCING){
|
||||
if(entity.currentAnimation == EnumAnimation.DANCING){
|
||||
float dancing = entity.ticksExisted / 4f;
|
||||
GL11.glTranslatef((float)Math.sin(dancing) * 0.015F, 0.0F, 0.0F);
|
||||
}
|
||||
|
||||
GL11.glTranslatef((float)Math.sin(dancing) * 0.015F, 0.0F, 0.0F);
|
||||
}
|
||||
|
||||
ModelPartConfig body = entity.modelData.body;
|
||||
// if(bipedBodywear.showModel && !bipedBodywear.isHidden){
|
||||
// if(entity.modelData.bodywear == 1 || isArmor){
|
||||
// ((ModelScaleRenderer)this.bipedBodywear).setConfig(body,x,y,z);
|
||||
// ((ModelScaleRenderer)this.bipedBodywear).render(f);
|
||||
// }
|
||||
//// else if(entity.modelData.bodywear == 2){
|
||||
//// this.bodywear.rotateAngleX = bipedBodywear.rotateAngleX;
|
||||
//// this.bodywear.rotateAngleY = bipedBodywear.rotateAngleY;
|
||||
//// this.bodywear.rotateAngleZ = bipedBodywear.rotateAngleZ;
|
||||
//// this.bodywear.rotationPointX = bipedBodywear.rotationPointX;
|
||||
//// this.bodywear.rotationPointY = bipedBodywear.rotationPointY;
|
||||
//// this.bodywear.rotationPointZ = bipedBodywear.rotationPointZ;
|
||||
//// this.bodywear.setConfig(body,x,y,z);
|
||||
//// this.bodywear.render(f);
|
||||
//// }
|
||||
// }
|
||||
if(entity.modelData.bodywear == 1){
|
||||
((ModelScaleRenderer)this.bipedBodywear).isHidden = false;
|
||||
}
|
||||
else{
|
||||
((ModelScaleRenderer)this.bipedBodywear).isHidden = true;
|
||||
}
|
||||
((ModelScaleRenderer)this.bipedBody).setConfig(body,x,y,z);
|
||||
((ModelScaleRenderer)this.bipedBody).render(f);
|
||||
GL11.glPopMatrix();
|
||||
|
||||
|
||||
}
|
||||
public void renderArms(EntityCustomNpc entity, float f, boolean bo){
|
||||
loadPlayerTexture(entity);
|
||||
@@ -420,11 +538,28 @@ public class ModelMPM extends ModelNPCMale{
|
||||
|
||||
GL11.glPushMatrix();
|
||||
|
||||
if(entity.currentAnimation == EnumAnimation.DANCING){
|
||||
if(entity.currentAnimation == EnumAnimation.DANCING){
|
||||
float dancing = entity.ticksExisted / 4f;
|
||||
GL11.glTranslatef((float)Math.sin(dancing) * 0.025F, (float)Math.abs(Math.cos(dancing)) * 0.125F - 0.02F, 0.0F);
|
||||
}
|
||||
|
||||
GL11.glTranslatef((float)Math.sin(dancing) * 0.025F, (float)Math.abs(Math.cos(dancing)) * 0.125F - 0.02F, 0.0F);
|
||||
}
|
||||
|
||||
if(entity.modelData.armwear == 1){
|
||||
this.bipedRightArmwear.isHidden = false;
|
||||
this.bipedLeftArmwear.isHidden = false;
|
||||
}
|
||||
else if(entity.modelData.armwear == 2){
|
||||
this.bipedRightArmwear.isHidden = true;
|
||||
this.bipedLeftArmwear.isHidden = false;
|
||||
}
|
||||
else if(entity.modelData.armwear == 3){
|
||||
this.bipedRightArmwear.isHidden = false;
|
||||
this.bipedLeftArmwear.isHidden = true;
|
||||
}
|
||||
else{
|
||||
this.bipedRightArmwear.isHidden = true;
|
||||
this.bipedLeftArmwear.isHidden = true;
|
||||
}
|
||||
|
||||
if(!bo){
|
||||
((ModelScaleRenderer)this.bipedLeftArm).setConfig(arms,-x,y,z);
|
||||
((ModelScaleRenderer)this.bipedLeftArm).render(f);
|
||||
@@ -447,6 +582,24 @@ public class ModelMPM extends ModelNPCMale{
|
||||
float z = 0;
|
||||
|
||||
GL11.glPushMatrix();
|
||||
|
||||
if(entity.modelData.legwear == 1){
|
||||
((ModelScaleRenderer)this.bipedRightLegWear).isHidden = false;
|
||||
((ModelScaleRenderer)this.bipedLeftLegWear).isHidden = false;
|
||||
}
|
||||
else if(entity.modelData.legwear == 2){
|
||||
((ModelScaleRenderer)this.bipedRightLegWear).isHidden = true;
|
||||
((ModelScaleRenderer)this.bipedLeftLegWear).isHidden = false;
|
||||
}
|
||||
else if(entity.modelData.legwear == 3){
|
||||
((ModelScaleRenderer)this.bipedRightLegWear).isHidden = false;
|
||||
((ModelScaleRenderer)this.bipedLeftLegWear).isHidden = true;
|
||||
}
|
||||
else{
|
||||
((ModelScaleRenderer)this.bipedRightLegWear).isHidden = true;
|
||||
((ModelScaleRenderer)this.bipedLeftLegWear).isHidden = true;
|
||||
}
|
||||
|
||||
this.legs.setConfig(legs,x,y,z);
|
||||
this.legs.render(f);
|
||||
if(!isArmor){
|
||||
@@ -456,22 +609,22 @@ public class ModelMPM extends ModelNPCMale{
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
@Override
|
||||
public ModelRenderer getRandomModelBox(Random par1Random)
|
||||
{
|
||||
public ModelRenderer getRandomModelBox(Random par1Random)
|
||||
{
|
||||
int random = par1Random.nextInt(5);
|
||||
switch(random){
|
||||
case 0:
|
||||
return bipedRightLeg;
|
||||
case 1:
|
||||
return bipedHead;
|
||||
case 2:
|
||||
return bipedLeftArm;
|
||||
case 3:
|
||||
return bipedRightArm;
|
||||
case 4:
|
||||
return bipedLeftLeg;
|
||||
case 0:
|
||||
return bipedRightLeg;
|
||||
case 1:
|
||||
return bipedHead;
|
||||
case 2:
|
||||
return bipedLeftArm;
|
||||
case 3:
|
||||
return bipedRightArm;
|
||||
case 4:
|
||||
return bipedLeftLeg;
|
||||
}
|
||||
|
||||
return bipedBody;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user