mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-11 23:07:37 +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
@@ -29,6 +29,11 @@ public class ModelDataShared{
|
||||
public byte breasts = 0;
|
||||
|
||||
public byte headwear = 2;
|
||||
|
||||
public byte bodywear = 0;
|
||||
|
||||
public byte armwear = 0;
|
||||
public byte legwear = 0;
|
||||
|
||||
public NBTTagCompound writeToNBT(){
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
@@ -44,6 +49,11 @@ public class ModelDataShared{
|
||||
compound.setTag("LegParts", legParts.writeToNBT());
|
||||
|
||||
compound.setByte("Headwear", headwear);
|
||||
compound.setByte("Bodywear", bodywear);
|
||||
|
||||
compound.setByte("Armwear", armwear);
|
||||
compound.setByte("Legwear", legwear);
|
||||
|
||||
compound.setByte("Breasts", breasts);
|
||||
compound.setTag("ExtraData", extra);
|
||||
|
||||
@@ -69,6 +79,11 @@ public class ModelDataShared{
|
||||
legParts.readFromNBT(compound.getCompoundTag("LegParts"));
|
||||
|
||||
headwear = compound.getByte("Headwear");
|
||||
bodywear = compound.getByte("Bodywear");
|
||||
|
||||
armwear = compound.getByte("Armwear");
|
||||
legwear = compound.getByte("Legwear");
|
||||
|
||||
breasts = compound.getByte("Breasts");
|
||||
extra = compound.getCompoundTag("ExtraData");
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ public class ModelPartData {
|
||||
this.texture = texture;
|
||||
}
|
||||
else{
|
||||
this.texture = "moreplayermodels:textures/"+ texture + ".png";
|
||||
this.texture = "customnpcs:textures/parts/"+ texture + ".png";
|
||||
playerTexture = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import noppes.npcs.entity.EntityCustomNpc;
|
||||
|
||||
public class GuiModelArms extends GuiModelInterface{
|
||||
|
||||
private final String[] arrArmwear = new String[]{"gui.no","Both","Left","Right"};
|
||||
private final String[] arrParticles = new String[]{"gui.no","Both","Left","Right"};
|
||||
|
||||
private GuiScreen parent;
|
||||
@@ -24,6 +25,11 @@ public class GuiModelArms extends GuiModelInterface{
|
||||
super.initGui();
|
||||
int y = guiTop + 20;
|
||||
|
||||
if (npc.display.modelType == 1 || npc.display.modelType == 2) {
|
||||
addButton(new GuiNpcButton(8, guiLeft + 50, y += 22, 70, 20, arrArmwear, playerdata.armwear));
|
||||
addLabel(new GuiNpcLabel(8, "Armwear", guiLeft, y + 5, 0xFFFFFF));
|
||||
}
|
||||
|
||||
ModelPartData claws = playerdata.getPartData("claws");
|
||||
addButton(new GuiNpcButton(0, guiLeft + 50, y += 22, 70, 20, arrParticles, claws == null?0:claws.type + 1));
|
||||
addLabel(new GuiNpcLabel(0, "Claws", guiLeft, y + 5, 0xFFFFFF));
|
||||
@@ -37,6 +43,9 @@ public class GuiModelArms extends GuiModelInterface{
|
||||
super.actionPerformed(btn);
|
||||
GuiNpcButton button = (GuiNpcButton) btn;
|
||||
|
||||
if(button.id == 8){
|
||||
playerdata.armwear = (byte) button.getValue();
|
||||
}
|
||||
if(button.id == 0){
|
||||
if(button.getValue() == 0)
|
||||
playerdata.removePart("claws");
|
||||
|
||||
@@ -11,6 +11,7 @@ import noppes.npcs.entity.EntityCustomNpc;
|
||||
public class GuiModelBody extends GuiModelInterface{
|
||||
|
||||
private GuiScreen parent;
|
||||
private final String[] arrBodywear = new String[]{"gui.no","gui.yes"};
|
||||
private final String[] arrWing = new String[]{"gui.no","Player","Type1","Type2","Type3","Type4","Type5","Type6","Type7","Type8","Type9",
|
||||
"Type10","Type11","Type12","Type13"};
|
||||
private final String[] arrBreasts = new String[]{"gui.no","Type1","Type2","Type3"};
|
||||
@@ -27,7 +28,14 @@ public class GuiModelBody extends GuiModelInterface{
|
||||
@Override
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
|
||||
int y = guiTop + 20;
|
||||
|
||||
if (npc.display.modelType == 1 || npc.display.modelType == 2) {
|
||||
addButton(new GuiNpcButton(8, guiLeft + 50, y += 22, 70, 20, arrBodywear, playerdata.bodywear));
|
||||
addLabel(new GuiNpcLabel(8, "Bodywear", guiLeft, y + 5, 0xFFFFFF));
|
||||
}
|
||||
|
||||
addButton(new GuiNpcButton(1, guiLeft + 50, y += 22, 70, 20, arrBreasts, playerdata.breasts));
|
||||
addLabel(new GuiNpcLabel(1, "Breasts", guiLeft, y + 5, 0xFFFFFF));
|
||||
|
||||
@@ -183,6 +191,10 @@ public class GuiModelBody extends GuiModelInterface{
|
||||
initGui();
|
||||
}
|
||||
|
||||
if(button.id == 8){
|
||||
playerdata.bodywear = (byte) button.getValue();
|
||||
}
|
||||
|
||||
if(button.id == 11){
|
||||
this.mc.displayGuiScreen(new GuiModelColor(this, playerdata.getPartData("wings"), npc));
|
||||
}
|
||||
|
||||
@@ -10,7 +10,8 @@ import noppes.npcs.entity.EntityCustomNpc;
|
||||
|
||||
public class GuiModelLegs extends GuiModelInterface{
|
||||
|
||||
private GuiScreen parent; // 0 1 2 3 4 5 6 7 8
|
||||
private GuiScreen parent;
|
||||
private final String[] arrLegwear = new String[]{"gui.no","Both","Left","Right"};
|
||||
private final String[] arrLegs = new String[]{"gui.no","Player","Player Naga","Spider","Horse","Naga", "Mermaid", "Mermaid 2","Digitigrade"};
|
||||
private final String[] arrTail = new String[]{"gui.no","Player", "Player Dragon","Cat","Wolf","Horse","Dragon", "Squirrel", "Fin", "Rodent", "Feather"};
|
||||
public GuiModelLegs(GuiScreen parent, EntityCustomNpc npc){
|
||||
@@ -24,6 +25,11 @@ public class GuiModelLegs extends GuiModelInterface{
|
||||
super.initGui();
|
||||
int y = guiTop + 20;
|
||||
|
||||
if (npc.display.modelType == 1 || npc.display.modelType == 2) {
|
||||
addButton(new GuiNpcButton(8, guiLeft + 50, y += 22, 70, 20, arrLegwear, playerdata.legwear));
|
||||
addLabel(new GuiNpcLabel(8, "Legwear", guiLeft, y + 5, 0xFFFFFF));
|
||||
}
|
||||
|
||||
addButton(new GuiNpcButton(1, guiLeft + 50, y += 22, 70, 20, arrLegs, getLegIndex(playerdata.legParts)));
|
||||
addLabel(new GuiNpcLabel(1, "Legs", guiLeft, y + 5, 0xFFFFFF));
|
||||
if(playerdata.legParts.type > 0)
|
||||
@@ -79,6 +85,9 @@ public class GuiModelLegs extends GuiModelInterface{
|
||||
super.actionPerformed(btn);
|
||||
GuiNpcButton button = (GuiNpcButton) btn;
|
||||
|
||||
if(button.id == 8){
|
||||
playerdata.legwear = (byte) button.getValue();
|
||||
}
|
||||
if(button.id == 1){
|
||||
ModelPartData data = playerdata.legParts;
|
||||
int value = button.getValue() - 1;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package api.player.model;
|
||||
|
||||
import net.minecraft.client.model.ModelBiped;
|
||||
|
||||
public class ModelPlayer extends ModelBiped {
|
||||
|
||||
public ModelPlayer() {
|
||||
this(0.0F);
|
||||
}
|
||||
|
||||
public ModelPlayer(float var1) {
|
||||
this(var1, 0.0F, 64, 32);
|
||||
}
|
||||
|
||||
public ModelPlayer(float var1, float var2, int var3, int var4) {
|
||||
super(var1, var2, var3, var4);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package noppes.npcs.client.model.part;
|
||||
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import noppes.npcs.client.model.util.Model2DRenderer;
|
||||
import noppes.npcs.client.model.util.ModelScaleRenderer;
|
||||
|
||||
public class ModelBodywear extends ModelScaleRenderer{
|
||||
|
||||
public ModelBodywear(ModelBase base) {
|
||||
super(base);
|
||||
|
||||
float scaler = 0.81f;
|
||||
float thick = 0.65f;
|
||||
|
||||
float x = -0.10f;
|
||||
float y = 12.76f;
|
||||
float z = -0.5f;
|
||||
|
||||
float z1 = 0.27f;
|
||||
|
||||
Model2DRenderer front = new Model2DRenderer(base, 20, 36, 8, 12, 64, 64);
|
||||
front.setRotationPoint(-4.588f, 0 + y, -2.302f + z);
|
||||
front.setScale(scaler);
|
||||
front.setThickness(thick);
|
||||
setRotation(front, 0, 0, 0);
|
||||
this.addChild(front);
|
||||
|
||||
Model2DRenderer back = new Model2DRenderer(base, 32, 36, 8, 12, 64, 64);
|
||||
back.setRotationPoint(4.588f, 0 + y, 2.302f);
|
||||
back.setScale(scaler);
|
||||
back.setThickness(thick);
|
||||
setRotation(back, 0, (float)(Math.PI), 0);
|
||||
this.addChild(back);
|
||||
|
||||
Model2DRenderer right = new Model2DRenderer(base, 28, 36, 4, 12, 64, 64);
|
||||
right.setRotationPoint(3.9425f, 0 + y, 2.29695f);
|
||||
right.setScale(scaler);
|
||||
right.setThickness(thick);
|
||||
setRotation(right, 0, (float)(Math.PI/2f), 0);
|
||||
this.addChild(right);
|
||||
|
||||
Model2DRenderer left = new Model2DRenderer(base, 16, 36, 4, 12, 64, 64);
|
||||
left.setRotationPoint(-3.9425f, 0 + y, -2.29695f + z);
|
||||
left.setScale(scaler);
|
||||
left.setThickness(thick);
|
||||
setRotation(left, 0, (float)(Math.PI/-2f), 0);
|
||||
this.addChild(left);
|
||||
|
||||
|
||||
Model2DRenderer top = new Model2DRenderer(base, 20, 32, 8, 4, 64, 64);
|
||||
top.setRotationPoint(-4.588f, -13.0f + y, -2.29695f);
|
||||
top.setScale(scaler/3);
|
||||
top.setThickness(thick);
|
||||
setRotation(top, (float)(Math.PI / -2), 0, 0);
|
||||
this.addChild(top);
|
||||
|
||||
Model2DRenderer bottom = new Model2DRenderer(base, 28, 32, 8, 4, 64, 64);
|
||||
bottom.setRotationPoint(-4.588f, -0.65f + y, -2.29695f);
|
||||
bottom.setScale(scaler/3);
|
||||
bottom.setThickness(thick);
|
||||
setRotation(bottom, (float)(Math.PI / -2), 0, 0);
|
||||
this.addChild(bottom);
|
||||
}
|
||||
|
||||
public void setRotation(ModelRenderer model, float x, float y, float z) {
|
||||
model.rotateAngleX = x;
|
||||
model.rotateAngleY = y;
|
||||
model.rotateAngleZ = z;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -15,7 +15,7 @@ public class ModelBreasts extends ModelPartInterface {
|
||||
public ModelBreasts(ModelMPM base) {
|
||||
super(base);
|
||||
|
||||
breasts = new Model2DRenderer(base, 20f, 22, 8, 3, 64, 32);
|
||||
breasts = new Model2DRenderer(base, 20f, 22, 8, 3, 64, 64);
|
||||
breasts.setRotationPoint(-3.6F, 5.2f, -3f);
|
||||
breasts.setScale(0.17f, 0.19f);
|
||||
breasts.setThickness(1);
|
||||
@@ -24,7 +24,7 @@ public class ModelBreasts extends ModelPartInterface {
|
||||
breasts2 = new ModelRenderer(base);
|
||||
this.addChild(breasts2);
|
||||
|
||||
Model2DRenderer bottom = new Model2DRenderer(base, 20f, 22, 8, 4, 64, 32);
|
||||
Model2DRenderer bottom = new Model2DRenderer(base, 20f, 22, 8, 4, 64, 64);
|
||||
bottom.setRotationPoint(-3.6F, 5f, -3.1f);
|
||||
bottom.setScale(0.225f, 0.20f);
|
||||
bottom.setThickness(2f);
|
||||
@@ -34,54 +34,54 @@ public class ModelBreasts extends ModelPartInterface {
|
||||
breasts3 = new ModelRenderer(base);
|
||||
this.addChild(breasts3);
|
||||
|
||||
Model2DRenderer right = new Model2DRenderer(base, 20f, 22, 3, 2, 64, 32);
|
||||
Model2DRenderer right = new Model2DRenderer(base, 20f, 22, 3, 2, 64, 64);
|
||||
right.setRotationPoint(-3.8F, 5.3f, -3.6f);
|
||||
right.setScale(0.12f, 0.14f);
|
||||
right.setThickness(1.75f);
|
||||
breasts3.addChild(right);
|
||||
|
||||
Model2DRenderer right2 = new Model2DRenderer(base, 20f, 22, 3, 1, 64, 32);
|
||||
Model2DRenderer right2 = new Model2DRenderer(base, 20f, 22, 3, 1, 64, 64);
|
||||
right2.setRotationPoint(-3.8F, 4.1f, -3.14f);
|
||||
right2.setScale(0.06f, 0.07f);
|
||||
right2.setThickness(1.75f);
|
||||
right2.rotateAngleX = (float) (Math.PI / 9);
|
||||
breasts3.addChild(right2);
|
||||
|
||||
Model2DRenderer right3 = new Model2DRenderer(base, 20f, 24, 3, 1, 64, 32);
|
||||
Model2DRenderer right3 = new Model2DRenderer(base, 20f, 24, 3, 1, 64, 64);
|
||||
right3.setRotationPoint(-3.8F, 5.3f, -3.6f);
|
||||
right3.setScale(0.06f, 0.07f);
|
||||
right3.setThickness(1.75f);
|
||||
right3.rotateAngleX = (float) (-Math.PI / 9);
|
||||
breasts3.addChild(right3);
|
||||
|
||||
Model2DRenderer right4 = new Model2DRenderer(base, 23f, 22, 1, 2, 64, 32);
|
||||
Model2DRenderer right4 = new Model2DRenderer(base, 23f, 22, 1, 2, 64, 64);
|
||||
right4.setRotationPoint(-1.8f, 5.3f, -3.14f);
|
||||
right4.setScale(0.12f, 0.14f);
|
||||
right4.setThickness(1.75f);
|
||||
right4.rotateAngleY = (float) (Math.PI / 9);
|
||||
breasts3.addChild(right4);
|
||||
|
||||
Model2DRenderer left = new Model2DRenderer(base, 25f, 22, 3, 2, 64, 32);
|
||||
Model2DRenderer left = new Model2DRenderer(base, 25f, 22, 3, 2, 64, 64);
|
||||
left.setRotationPoint(0.8F, 5.3f, -3.6f);
|
||||
left.setScale(0.12f, 0.14f);
|
||||
left.setThickness(1.75f);
|
||||
breasts3.addChild(left);
|
||||
|
||||
Model2DRenderer left2 = new Model2DRenderer(base, 25f, 22, 3, 1, 64, 32);
|
||||
Model2DRenderer left2 = new Model2DRenderer(base, 25f, 22, 3, 1, 64, 64);
|
||||
left2.setRotationPoint(0.8F, 4.1f, -3.18f);
|
||||
left2.setScale(0.06f, 0.07f);
|
||||
left2.setThickness(1.75f);
|
||||
left2.rotateAngleX = (float) (Math.PI / 9);
|
||||
breasts3.addChild(left2);
|
||||
|
||||
Model2DRenderer left3 = new Model2DRenderer(base, 25f, 24, 3, 1, 64, 32);
|
||||
Model2DRenderer left3 = new Model2DRenderer(base, 25f, 24, 3, 1, 64, 64);
|
||||
left3.setRotationPoint(0.8F, 5.3f, -3.6f);
|
||||
left3.setScale(0.06f, 0.07f);
|
||||
left3.setThickness(1.75f);
|
||||
left3.rotateAngleX = (float) (-Math.PI / 9);
|
||||
breasts3.addChild(left3);
|
||||
|
||||
Model2DRenderer left4 = new Model2DRenderer(base, 24f, 22, 1, 2, 64, 32);
|
||||
Model2DRenderer left4 = new Model2DRenderer(base, 24f, 22, 1, 2, 64, 64);
|
||||
left4.setRotationPoint(0.8f, 5.3f, -3.6f);
|
||||
left4.setScale(0.12f, 0.14f);
|
||||
left4.setThickness(1.75f);
|
||||
|
||||
@@ -3,18 +3,11 @@ package noppes.npcs.client.renderer;
|
||||
import static net.minecraftforge.client.IItemRenderer.ItemRenderType.EQUIPPED;
|
||||
import static net.minecraftforge.client.IItemRenderer.ItemRendererHelper.BLOCK_3D;
|
||||
|
||||
import com.mojang.authlib.minecraft.MinecraftProfileTexture;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.entity.AbstractClientPlayer;
|
||||
import net.minecraft.client.model.ModelBiped;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.entity.RenderBiped;
|
||||
import net.minecraft.client.renderer.texture.ITextureObject;
|
||||
import net.minecraft.client.renderer.texture.TextureManager;
|
||||
import net.minecraft.client.resources.IResource;
|
||||
import net.minecraft.client.resources.SkinManager;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
@@ -28,26 +21,16 @@ import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.ForgeHooksClient;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
import net.minecraftforge.client.MinecraftForgeClient;
|
||||
import noppes.npcs.client.ImageDownloadAlt;
|
||||
import noppes.npcs.client.model.ModelMPM;
|
||||
import noppes.npcs.client.model.ModelNPCMale;
|
||||
import noppes.npcs.constants.EnumAnimation;
|
||||
import noppes.npcs.entity.EntityCustomNpc;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
import noppes.npcs.entity.EntityNpcPony;
|
||||
import noppes.npcs.items.ItemClaw;
|
||||
import noppes.npcs.items.ItemShield;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import java.awt.*;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.security.MessageDigest;
|
||||
import java.util.Map;
|
||||
|
||||
public class RenderNPCHumanMale extends RenderNPCInterface
|
||||
{
|
||||
|
||||
@@ -55,8 +38,16 @@ public class RenderNPCHumanMale extends RenderNPCInterface
|
||||
protected ModelNPCMale modelArmorChestplate;
|
||||
protected ModelNPCMale modelArmor;
|
||||
|
||||
protected final ModelNPCMale OGmodelArmorChestplate = new ModelMPM(1, false, false);
|
||||
protected final ModelNPCMale OGmodelArmor = new ModelMPM(0.5f, false, false);
|
||||
|
||||
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 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);
|
||||
|
||||
public RenderNPCHumanMale(ModelNPCMale mainmodel, ModelNPCMale armorChest, ModelNPCMale armor)
|
||||
{
|
||||
@@ -131,20 +122,31 @@ public class RenderNPCHumanMale extends RenderNPCInterface
|
||||
public void renderPlayer(EntityNPCInterface npc, double d, double d1, double d2,
|
||||
float f, float f1)
|
||||
{
|
||||
|
||||
// SEEMS TO WORK FOR NOW. Keeps NPC from outsyncing with Creature Models
|
||||
if(npc instanceof EntityCustomNpc){
|
||||
EntityCustomNpc test = (EntityCustomNpc) npc;
|
||||
if(test.modelData.entityClass == null){
|
||||
int modelVal = npc.display.modelType;
|
||||
if(modelVal == 0){
|
||||
this.mainModel = originalModel;
|
||||
}
|
||||
else if(modelVal == 1){
|
||||
if(modelVal == 1){
|
||||
this.mainModel = steve;
|
||||
this.modelBipedMain = steve;
|
||||
this.modelArmorChestplate = steveArmorChestplate;
|
||||
this.modelArmor = steveModelArmor;
|
||||
}
|
||||
else if(modelVal == 2){
|
||||
this.mainModel = alex;
|
||||
this.modelBipedMain = alex;
|
||||
this.modelArmorChestplate = alexArmorChestplate;
|
||||
this.modelArmor = alexModelArmor;
|
||||
}
|
||||
else{
|
||||
this.mainModel = alex;
|
||||
((EntityCustomNpc) npc).modelData.bodywear = 0;
|
||||
((EntityCustomNpc) npc).modelData.armwear = 0;
|
||||
((EntityCustomNpc) npc).modelData.legwear = 0;
|
||||
this.mainModel = originalModel;
|
||||
this.modelBipedMain = (ModelNPCMale) originalModel;
|
||||
this.modelArmorChestplate = OGmodelArmorChestplate;
|
||||
this.modelArmor = OGmodelArmor;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -167,6 +167,8 @@ public abstract class EntityNPCInterface extends EntityCreature implements IEnti
|
||||
private int taskCount = 1;
|
||||
public int lastInteract = 0;
|
||||
|
||||
public int animationStart = 0;
|
||||
|
||||
public Faction faction; //should only be used server side
|
||||
|
||||
private EntityAIRangedAttack aiRange;
|
||||
|
||||
Reference in new issue
Block a user