mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-13 00:47:50 +00:00
Alex armor now renders correctly for NPCs.
This commit is contained in:
1 parent
2b15ba9197
commit
0ed5887046
3 files changed
+46
-9
No files matched your search
@@ -64,6 +64,7 @@ public class ModelMPM extends ModelNPCMale{
|
||||
public boolean currentlyPlayerTexture;
|
||||
|
||||
public boolean isArmor;
|
||||
public boolean isAlexArmor;
|
||||
public float alpha = 1;
|
||||
|
||||
// Steve 64x64 and Alex 64x64
|
||||
@@ -194,10 +195,14 @@ public class ModelMPM extends ModelNPCMale{
|
||||
}
|
||||
|
||||
// Steve 64x32
|
||||
public ModelMPM(float par1) {
|
||||
public ModelMPM(float par1, int alexArms) {
|
||||
|
||||
super(par1);
|
||||
isArmor = par1 > 0;
|
||||
if (isArmor && alexArms == 1) {
|
||||
isAlexArmor = true;
|
||||
}
|
||||
|
||||
float par2 = 0;
|
||||
|
||||
this.bipedCloak = new ModelRenderer(this, 0, 0);
|
||||
@@ -219,14 +224,30 @@ 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);
|
||||
|
||||
this.bipedRightArm = new ModelScaleRenderer(this, 40, 16);
|
||||
this.bipedRightArm.addBox(-3.0F, -2.0F, -2.0F, 4, 12, 4, par1);
|
||||
this.bipedRightArm.setRotationPoint(-5.0F, 2.0F + par2, 0.0F);
|
||||
if (alexArms == 0) {
|
||||
this.bipedRightArm = new ModelScaleRenderer(this, 40, 16);
|
||||
this.bipedRightArm.addBox(-3.0F, -2.0F, -2.0F, 4, 12, 4, par1);
|
||||
this.bipedRightArm.setRotationPoint(-5.0F, 2.0F + par2, 0.0F);
|
||||
|
||||
this.bipedLeftArm = new ModelScaleRenderer(this, 40, 16);
|
||||
this.bipedLeftArm.mirror = true;
|
||||
this.bipedLeftArm.addBox(-1.0F, -2.0F, -2.0F, 4, 12, 4, par1);
|
||||
this.bipedLeftArm.setRotationPoint(5.0F, 2.0F + par2, 0.0F);
|
||||
this.bipedLeftArm = new ModelScaleRenderer(this, 40, 16);
|
||||
this.bipedLeftArm.mirror = true;
|
||||
this.bipedLeftArm.addBox(-1.0F, -2.0F, -2.0F, 4, 12, 4, par1);
|
||||
this.bipedLeftArm.setRotationPoint(5.0F, 2.0F + par2, 0.0F);
|
||||
} else {
|
||||
this.bipedRightArm = (new ModelScaleRenderer(this, 40, 16));
|
||||
this.bipedLeftArm = new ModelScaleRenderer(this, 40, 16);
|
||||
this.bipedLeftArm.mirror = true;
|
||||
|
||||
if (isArmor) {
|
||||
this.bipedLeftArm.setRotationPoint(5.0F, 2.5F + par2, 0.0F);
|
||||
this.bipedRightArm.addBox(-4.5F, -2.0F, -2.0F, 4, 12, 4, par1);
|
||||
this.bipedLeftArm.addBox(0.25F, -2.0F, -2.0F, 4, 12, 4, par1);
|
||||
} else {
|
||||
this.bipedLeftArm.setRotationPoint(5.0F, 2.5F + par2, 0.0F);
|
||||
this.bipedRightArm.addBox(-2.0F, -2.0F, -2.0F, 3, 12, 4, par1);
|
||||
this.bipedLeftArm.addBox(-1.0F, -2.0F, -2.0F, 3, 12, 4, par1);
|
||||
}
|
||||
}
|
||||
|
||||
this.bipedRightLeg = new ModelScaleRenderer(this, 0, 16);
|
||||
this.bipedRightLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, par1);
|
||||
@@ -588,6 +609,10 @@ public class ModelMPM extends ModelNPCMale{
|
||||
|
||||
GL11.glPushMatrix();
|
||||
|
||||
if (isAlexArmor) {
|
||||
GL11.glScalef(0.75F,1.0F,1.0F);
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
@@ -29,7 +29,7 @@ public class RenderCustomNpc extends RenderNPCHumanMale{
|
||||
|
||||
// Default Renderer
|
||||
public RenderCustomNpc() {
|
||||
super(new ModelMPM(0), new ModelMPM(1), new ModelMPM(0.5f));
|
||||
super(new ModelMPM(0,0), new ModelMPM(1,0), new ModelMPM(0.5f,0));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -37,6 +37,12 @@ public class RenderNPCHumanMale extends RenderNPCInterface
|
||||
protected final static ModelMPM steve64 = new ModelMPM(0, false);
|
||||
protected final static ModelMPM alex = new ModelMPM(0, true);
|
||||
|
||||
protected final static ModelMPM steveArmorChest = new ModelMPM(1,0);
|
||||
protected final static ModelMPM steveArmor = new ModelMPM(0.5F,0);
|
||||
|
||||
protected final static ModelMPM alex32armorChest = new ModelMPM(1,1);
|
||||
protected final static ModelMPM alex32armor = new ModelMPM(0.5F,1);
|
||||
|
||||
public RenderNPCHumanMale(ModelNPCMale mainmodel, ModelNPCMale armorChest, ModelNPCMale armor)
|
||||
{
|
||||
super(mainmodel, 0.5F);
|
||||
@@ -118,10 +124,14 @@ public class RenderNPCHumanMale extends RenderNPCInterface
|
||||
if(modelVal == 1){
|
||||
this.mainModel = steve64;
|
||||
this.modelBipedMain = steve64;
|
||||
this.modelArmorChestplate = steveArmorChest;
|
||||
this.modelArmor = steveArmor;
|
||||
}
|
||||
else if(modelVal == 2){
|
||||
this.mainModel = alex;
|
||||
this.modelBipedMain = alex;
|
||||
this.modelArmorChestplate = alex32armorChest;
|
||||
this.modelArmor = alex32armor;
|
||||
}
|
||||
else{
|
||||
((EntityCustomNpc) npc).modelData.bodywear = 0;
|
||||
@@ -129,6 +139,8 @@ public class RenderNPCHumanMale extends RenderNPCInterface
|
||||
((EntityCustomNpc) npc).modelData.legwear = 0;
|
||||
this.mainModel = originalModel;
|
||||
this.modelBipedMain = originalBipedMain;
|
||||
this.modelArmorChestplate = steveArmorChest;
|
||||
this.modelArmor = steveArmor;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user