Fixed Missing Texture Error

FIxed the Missing Texture Bug
Started to work on Reset Buttons
This commit is contained in:
KAMKEEL committed 2021-05-09 02:58:18 -04:00
1 parent 8d455c329b
commit 169eba238b
3 files changed
+31 -7

No files matched your search

+2 -2
View File
@@ -24,7 +24,7 @@ public class DataDisplay {
public String url = "";
public GameProfile playerProfile;
public String texture = "customnpcs:textures/entity/humanmale/Steve.png";;
public String texture = "customnpcs:textures/entity/humanmale/Steve.png";
public String cloakTexture = "";
public String glowTexture = "";
@@ -120,7 +120,7 @@ public class DataDisplay {
cloakTexture = nbttagcompound.getString("CloakTexture");
glowTexture = nbttagcompound.getString("GlowTexture");
modelSize = ValueUtil.CorrectInt(nbttagcompound.getInteger("Size"), 1, 40);
modelSize = ValueUtil.CorrectInt(nbttagcompound.getInteger("Size"), 1, 30);
modelType = nbttagcompound.getInteger("modelType");
showName = nbttagcompound.getInteger("ShowName");
@@ -71,24 +71,45 @@ public class GuiModelScale extends GuiModelInterface implements ISliderListener{
private void drawSlider(int y, ModelPartConfig config){
y += 15;
addLabel(new GuiNpcLabel(10, "Width", guiLeft, y + 5, 0xFFFFFF));
addLabel(new GuiNpcLabel(10, "Width", guiLeft - 25, y + 5, 0xFFFFFF));
addSlider(new GuiNpcSlider(this, 10, guiLeft + 50, y, config.scaleX - 0.5f));
addButton(new GuiNpcButton(170, guiLeft + 8, y, 40, 20, "Reset"));
y += 22;
addLabel(new GuiNpcLabel(11, "Height", guiLeft, y + 5, 0xFFFFFF));
addLabel(new GuiNpcLabel(11, "Height", guiLeft - 25, y + 5, 0xFFFFFF));
addSlider(new GuiNpcSlider(this, 11, guiLeft + 50, y, config.scaleY - 0.5f));
addButton(new GuiNpcButton(171, guiLeft + 8, y, 40, 20, "Reset"));
y += 22;
addLabel(new GuiNpcLabel(12, "Depth", guiLeft, y + 5, 0xFFFFFF));
addLabel(new GuiNpcLabel(12, "Depth", guiLeft - 25, y + 5, 0xFFFFFF));
addSlider(new GuiNpcSlider(this, 12, guiLeft + 50, y, config.scaleZ - 0.5f));
addButton(new GuiNpcButton(172, guiLeft + 8, y, 40, 20, "Reset"));
}
@Override
protected void actionPerformed(GuiButton btn) {
super.actionPerformed(btn);
if(btn.id < 4){
type = btn.id;
initGui();
}
// Resetting Type
ModelPartConfig config = playerdata.head;
if(type == 1)
config = playerdata.body;
else if(type == 2)
config = playerdata.arms;
else if(type == 3)
config = playerdata.legs;
if(btn.id == 170){
System.out.println(config.scaleX);
System.out.println(config.scaleY);
System.out.println(config.scaleZ);
}
}
@Override
@@ -267,8 +267,11 @@ public class RenderNPCInterface extends RenderLiving{
EntityNPCInterface npc = (EntityNPCInterface) entity;
if(npc.textureLocation == null){
if(npc.display.skinType == 0)
npc.textureLocation = new ResourceLocation(npc.display.texture);
if(npc.display.skinType == 0) {
if (!(npc.display.texture).equals("")) {
npc.textureLocation = new ResourceLocation(npc.display.texture);
}
}
else if(LastTextureTick < 5){ //fixes request flood somewhat
return AbstractClientPlayer.locationStevePng;
}