Alex and Steve skins now switch to x64 or x32 models automatically.

This commit is contained in:
Luis C.M committed 2022-05-28 05:53:14 -05:00
1 parent 2b15ba9197
commit 4aa1799ec3
6 files changed
+69 -30

No files matched your search

@@ -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,10 @@ 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 alex32mainmodel = new ModelMPM(0,1);
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);
@@ -115,13 +119,32 @@ public class RenderNPCHumanMale extends RenderNPCInterface
EntityCustomNpc test = (EntityCustomNpc) npc;
if(test.modelData.entityClass == null){
int modelVal = npc.display.modelType;
if(modelVal == 1){
if(modelVal == 1 && npc.display.x64texture){
this.mainModel = steve64;
this.modelBipedMain = steve64;
}
else if(modelVal == 2){
this.mainModel = alex;
this.modelBipedMain = alex;
if (npc.display.x64texture) {
this.mainModel = alex;
this.modelBipedMain = alex;
} else {
((EntityCustomNpc) npc).modelData.bodywear = 0;
((EntityCustomNpc) npc).modelData.armwear = 0;
((EntityCustomNpc) npc).modelData.legwear = 0;
this.mainModel = alex32mainmodel;
this.modelBipedMain = alex32mainmodel;
this.modelArmorChestplate = alex32armorChest;
this.modelArmor = alex32armor;
}
}
else if(modelVal == 3){
((EntityCustomNpc) npc).modelData.bodywear = 0;
((EntityCustomNpc) npc).modelData.armwear = 0;
((EntityCustomNpc) npc).modelData.legwear = 0;
this.mainModel = alex32mainmodel;
this.modelBipedMain = alex32mainmodel;
this.modelArmorChestplate = alex32armorChest;
this.modelArmor = alex32armor;
}
else{
((EntityCustomNpc) npc).modelData.bodywear = 0;
@@ -363,7 +363,8 @@ public class RenderNPCInterface extends RenderLiving{
int totalWidth = bufferedimage.getWidth();
int totalHeight = bufferedimage.getHeight();
if (totalHeight > 32 && npc.display.modelType == 0) {
npc.display.x64texture = totalHeight > 32;
if (npc.display.x64texture && (npc.display.modelType == 0 || npc.display.modelType == 3)) {
bufferedimage = bufferedimage.getSubimage(0, 0, totalWidth, 32);
}