More fixes to setting NPC model types.

This commit is contained in:
Luis C.M committed 2022-05-28 07:06:38 -05:00
1 parent 968b43a321
commit 0028328db4
3 files changed
+8 -6

No files matched your search

@@ -270,13 +270,13 @@ public class GuiCreationScreen extends GuiModelInterface implements ICustomScrol
// New Button for Changing Models
// URL Swapper
if(button.id == 250){
npc.display.modelType = button.getValue() * 2;
npc.display.modelType = button.displayString.equals("Alex") ? 2 : 1;
if(npc.display.modelType == 0){
if(npc.display.modelType == 1){
if (npc.display.skinType == 2){
npc.display.skinType = 3;
}
} else if(npc.display.modelType == 2) {
} else {
if (npc.display.skinType == 3){
npc.display.skinType = 2;
}
@@ -364,8 +364,10 @@ public class RenderNPCInterface extends RenderLiving{
int totalHeight = bufferedimage.getHeight();
npc.display.x64texture = totalHeight > 32;
if (npc.display.x64texture && (npc.display.modelType == 0 || npc.display.modelType == 3)) {
bufferedimage = bufferedimage.getSubimage(0, 0, totalWidth, 32);
if (npc.display.x64texture) {
if (npc.display.modelType == 0 || npc.display.modelType == 3) {
bufferedimage = bufferedimage.getSubimage(0, 0, totalWidth, 32);
}
}
ImageDownloadAlt object = new ImageDownloadAlt(null, npc.display.texture, SkinManager.field_152793_a, new ImageBufferDownloadAlt(false));
@@ -80,7 +80,7 @@ public class ScriptNpc<T extends EntityNPCInterface> extends ScriptLiving<T> imp
modelType = 1;
else if(modelType < 0)
modelType = 0;
npc.display.modelType = modelType * 2;
npc.display.modelType = modelType + 1;
npc.script.clientNeedsUpdate = true;
}