Fixed SkinUrl for 64x64 Textures

Must Enable the Square Texture Button on NPC in order to work correct. Local Textures work just fine normally.
This commit is contained in:
KAMKEEL committed 2021-04-29 14:37:33 -04:00
1 parent 51b8e34c02
commit aeb807cea7
7 files changed
+19 -8

No files matched your search

@@ -35,6 +35,8 @@ public class DataDisplay {
public boolean disableLivingAnimation = false;
public byte showBossBar = 0;
public byte squareTexture = 0;
public DataDisplay(EntityNPCInterface npc){
this.npc = npc;
@@ -86,6 +88,7 @@ public class DataDisplay {
nbttagcompound.setBoolean("NoLivingAnimation", disableLivingAnimation);
nbttagcompound.setByte("BossBar", showBossBar);
nbttagcompound.setByte("SquareTexture", squareTexture);
return nbttagcompound;
}
@@ -121,6 +124,7 @@ public class DataDisplay {
disableLivingAnimation = nbttagcompound.getBoolean("NoLivingAnimation");
showBossBar = nbttagcompound.getByte("BossBar");
squareTexture = nbttagcompound.getByte("SquareTexture");
if(prevSkinType != skinType || !texture.equals(prevTexture))
npc.textureLocation = null;
@@ -73,16 +73,20 @@ public class GuiNpcDisplay extends GuiNPCInterface2 implements ITextfieldListene
y+=23;
addLabel(new GuiNpcLabel(5,"display.livingAnimation", guiLeft + 5, y + 5));
this.addButton(new GuiNpcButton(5, guiLeft + 120, y, 50, 20, new String[]{"gui.yes","gui.no"},display.disableLivingAnimation?1:0));
this.addButton(new GuiNpcButton(5, guiLeft + 120, y, 50, 20, new String[]{"gui.yes","gui.no"}, display.disableLivingAnimation?1:0));
y+=23;
// Square Texture Button
addLabel(new GuiNpcLabel(300,"display.squareTexture", guiLeft + 230, y + 5));
this.addButton(new GuiNpcButton(300, guiLeft + 313, y, 50, 20, new String[]{"gui.no","gui.yes"}, display.squareTexture));
y+=23;
addLabel(new GuiNpcLabel(7,"display.visible", guiLeft + 5, y + 5));
this.addButton(new GuiNpcButton(7, guiLeft + 120, y, 50, 20, new String[]{"gui.yes","gui.no","gui.partly"}, display.visible));
y+=23;
addLabel(new GuiNpcLabel(10,"display.bossbar", guiLeft + 5, y + 5));
this.addButton(new GuiNpcButton(10, guiLeft + 120, y, 110, 20, new String[]{"display.hide","display.show","display.showAttacking"}, display.showBossBar));
//addExtra(new GuiHoverText(0, "testing", guiLeft, guiTop));
}
@@ -146,6 +150,9 @@ public class GuiNpcDisplay extends GuiNPCInterface2 implements ITextfieldListene
else if(button.id == 7){
display.visible = button.getValue();
}
else if(button.id == 300){
display.squareTexture = (byte)button.getValue();
}
else if(button.id == 8){
NoppesUtil.openGUI(player, new GuiNpcTextureCloaks(npc, this));
}
@@ -286,7 +286,7 @@ public class RenderNPCInterface extends RenderLiving{
public ResourceLocation getEntityTexture(Entity entity) {
EntityNPCInterface npc = (EntityNPCInterface) entity;
boolean versionModel = npc.isUpdatedVersion; // DOES NOT WORK
boolean versionModel = false; // Square Texture
if(npc.textureLocation == null){
if(npc.display.skinType == 0)
npc.textureLocation = new ResourceLocation(npc.display.texture);
@@ -310,6 +310,9 @@ public class RenderNPCInterface extends RenderLiving{
sb.append(String.format("%02x", b&0xff));
}
npc.textureLocation = new ResourceLocation("skins/" + sb.toString());
if(npc.display.squareTexture == 1){ versionModel = true; }
loadSkin(null, npc.textureLocation, npc.display.url, versionModel);
LastTextureTick = 0;
}
@@ -14,7 +14,6 @@ public class EntityCustomNpc extends EntityNPCInterface{
public EntityCustomNpc(World world) {
super(world);
isUpdatedVersion = false;
}
@Override
@@ -14,7 +14,6 @@ public class EntityCustomNpc64 extends EntityCustomNpc{
public EntityCustomNpc64(World world) {
super(world);
display.texture = "customnpcs:textures/entity/humanmale/Steve64.png";
isUpdatedVersion = true;
}
}
@@ -185,8 +185,6 @@ public abstract class EntityNPCInterface extends EntityCreature implements IEnti
public boolean updateClient = false;
public boolean updateAI = false;
public boolean isUpdatedVersion = false;
public EntityNPCInterface(World world) {
super(world);
try{