diff --git a/src/main/java/noppes/npcs/DataDisplay.java b/src/main/java/noppes/npcs/DataDisplay.java index 15dbe469a..678b06e94 100644 --- a/src/main/java/noppes/npcs/DataDisplay.java +++ b/src/main/java/noppes/npcs/DataDisplay.java @@ -184,7 +184,6 @@ public class DataDisplay { if(prevSkinType != skinType || !texture.equals(prevTexture)) npc.textureLocation = null; - npc.textureGlowLocation = null; npc.textureCloakLocation = null; npc.updateHitbox(); } diff --git a/src/main/java/noppes/npcs/client/EntityUtil.java b/src/main/java/noppes/npcs/client/EntityUtil.java index 8da93fe43..e8a9c7523 100644 --- a/src/main/java/noppes/npcs/client/EntityUtil.java +++ b/src/main/java/noppes/npcs/client/EntityUtil.java @@ -90,7 +90,6 @@ public class EntityUtil { EntityNPCInterface target = (EntityNPCInterface) entity; target.textureLocation = npc.textureLocation; - target.textureGlowLocation = npc.textureGlowLocation; target.textureCloakLocation = npc.textureCloakLocation; target.display = npc.display; target.inventory = npc.inventory; diff --git a/src/main/java/noppes/npcs/client/gui/GuiNpcTextureOverlays.java b/src/main/java/noppes/npcs/client/gui/GuiNpcTextureOverlays.java index 4a67adc62..d0152dcd6 100644 --- a/src/main/java/noppes/npcs/client/gui/GuiNpcTextureOverlays.java +++ b/src/main/java/noppes/npcs/client/gui/GuiNpcTextureOverlays.java @@ -77,7 +77,7 @@ public class GuiNpcTextureOverlays extends GuiNpcSelectionInterface{ public void elementClicked(){ if(dataTextures.contains(slot.selected) && slot.selected != null){ //npc.display.glowTexture = assets.getAsset(slot.selected); - npc.textureGlowLocation = null; + //npc.textureGlowLocation = null; npc.display.skinOverlayData.overlayList.put(0,new SkinOverlay( assets.getAsset(slot.selected), true, 1.0F, 1.0F, 0.0F, 0.0F, diff --git a/src/main/java/noppes/npcs/client/gui/mainmenu/GuiNpcDisplay.java b/src/main/java/noppes/npcs/client/gui/mainmenu/GuiNpcDisplay.java index f6423f312..2c1621059 100644 --- a/src/main/java/noppes/npcs/client/gui/mainmenu/GuiNpcDisplay.java +++ b/src/main/java/noppes/npcs/client/gui/mainmenu/GuiNpcDisplay.java @@ -129,12 +129,14 @@ public class GuiNpcDisplay extends GuiNPCInterface2 implements ITextfieldListene display.cloakTexture = textfield.getText(); } else if(textfield.id == 9){ - npc.textureGlowLocation = null; + //npc.textureGlowLocation = null; //display.glowTexture = textfield.getText(); - npc.display.skinOverlayData.overlayList.put(0,new SkinOverlay( - textfield.getText(), true, 1.0F, 1.0F, 0.0F, 0.0F, - 1.0F, 1.0F, 0.0F, 0.0F, 0.0F - )); + if (!textfield.getText().isEmpty()) { + npc.display.skinOverlayData.overlayList.put(0, new SkinOverlay( + textfield.getText(), true, 1.0F, 1.0F, 0.0F, 0.0F, + 1.0F, 1.0F, 0.0F, 0.0F, 0.0F + )); + } } else if(textfield.id == 11){ display.title = textfield.getText(); diff --git a/src/main/java/noppes/npcs/client/gui/model/GuiCreationScreen.java b/src/main/java/noppes/npcs/client/gui/model/GuiCreationScreen.java index 82c5a76ef..f7d6f2c75 100644 --- a/src/main/java/noppes/npcs/client/gui/model/GuiCreationScreen.java +++ b/src/main/java/noppes/npcs/client/gui/model/GuiCreationScreen.java @@ -231,7 +231,6 @@ public class GuiCreationScreen extends GuiModelInterface implements ICustomScrol //npc.display.glowTexture = ""; npc.display.skinOverlayData.overlayList.remove(0); npc.textureLocation = null; - npc.textureGlowLocation = null; npc.updateHitbox(); } catch(Exception ex){ @@ -286,6 +285,7 @@ public class GuiCreationScreen extends GuiModelInterface implements ICustomScrol } npc.display.modelType = 0; } + npc.textureLocation = null; } if(button.id == 8){ @@ -339,7 +339,6 @@ public class GuiCreationScreen extends GuiModelInterface implements ICustomScrol //npc.display.glowTexture = ""; npc.display.skinOverlayData.overlayList.remove(0); npc.textureLocation = null; - npc.textureGlowLocation = null; npc.updateHitbox(); } catch(Exception ex){ diff --git a/src/main/java/noppes/npcs/client/gui/model/GuiEntitySelection.java b/src/main/java/noppes/npcs/client/gui/model/GuiEntitySelection.java index 15704114e..0e124d88e 100644 --- a/src/main/java/noppes/npcs/client/gui/model/GuiEntitySelection.java +++ b/src/main/java/noppes/npcs/client/gui/model/GuiEntitySelection.java @@ -129,7 +129,6 @@ public class GuiEntitySelection extends GuiNPCInterface //npc.display.glowTexture = ""; npc.display.skinOverlayData.overlayList.remove(0); npc.textureLocation = null; - npc.textureGlowLocation = null; npc.updateHitbox(); } catch(Exception ex){ diff --git a/src/main/java/noppes/npcs/client/renderer/RenderCNPCPlayer.java b/src/main/java/noppes/npcs/client/renderer/RenderCNPCPlayer.java index c8c005025..fe913ebe1 100644 --- a/src/main/java/noppes/npcs/client/renderer/RenderCNPCPlayer.java +++ b/src/main/java/noppes/npcs/client/renderer/RenderCNPCPlayer.java @@ -48,6 +48,9 @@ public class RenderCNPCPlayer extends RenderPlayer { private boolean preRenderOverlay(EntityPlayer player, ResourceLocation overlayLocation, boolean glow, float alpha, float size, float speedX, float speedY, float scaleX, float scaleY, float offsetX, float offsetY, float offsetZ) { + if (overlayLocation.getResourcePath().isEmpty()) + return false; + try { this.bindTexture(overlayLocation); } catch (Exception exception) { @@ -112,6 +115,9 @@ public class RenderCNPCPlayer extends RenderPlayer { { if (Client.skinOverlays.containsKey(player.getUniqueID())) { for (SkinOverlay overlayData : Client.skinOverlays.get(player.getUniqueID()).values()) { + if (overlayData.texture.isEmpty()) + continue; + if (overlayData.location == null) { overlayData.location = new ResourceLocation(overlayData.texture); } else { @@ -312,6 +318,9 @@ public class RenderCNPCPlayer extends RenderPlayer { if (Client.skinOverlays.containsKey(player.getUniqueID())) { for (SkinOverlay overlayData : Client.skinOverlays.get(player.getUniqueID()).values()) { + if (overlayData.texture.isEmpty()) + continue; + if (overlayData.location == null) { overlayData.location = new ResourceLocation(overlayData.texture); } else { diff --git a/src/main/java/noppes/npcs/client/renderer/RenderNPCInterface.java b/src/main/java/noppes/npcs/client/renderer/RenderNPCInterface.java index 74f428de9..9f79fb06d 100644 --- a/src/main/java/noppes/npcs/client/renderer/RenderNPCInterface.java +++ b/src/main/java/noppes/npcs/client/renderer/RenderNPCInterface.java @@ -22,6 +22,7 @@ import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.boss.BossStatus; +import net.minecraft.util.ReportedException; import net.minecraft.util.ResourceLocation; import noppes.npcs.client.ImageDownloadAlt; import noppes.npcs.client.model.ModelMPM; @@ -221,6 +222,9 @@ public class RenderNPCInterface extends RenderLiving{ if (!npc.display.skinOverlayData.overlayList.isEmpty()) { for (ISkinOverlay overlayData : npc.display.skinOverlayData.overlayList.values()) { try { + if (overlayData.getTexture().isEmpty()) + continue; + if (overlayData.getLocation() == null) { overlayData.setLocation(new ResourceLocation(overlayData.getTexture())); } else { @@ -230,7 +234,12 @@ public class RenderNPCInterface extends RenderLiving{ } } - this.bindTexture(overlayData.getLocation()); + if (overlayData.getLocation().getResourcePath().isEmpty()) + continue; + + try { + this.bindTexture(overlayData.getLocation()); + } catch (Exception e) { continue; } // Overlay & Glow GL11.glEnable(GL11.GL_BLEND); @@ -340,13 +349,12 @@ public class RenderNPCInterface extends RenderLiving{ } private ResourceLocation adjustLocalTexture(EntityNPCInterface npc, ResourceLocation location) throws IOException { - if (npc.display.modelType != 0) { - return location; - } - InputStream inputstream = null; try { + TextureManager texturemanager = Minecraft.getMinecraft().getTextureManager(); + texturemanager.deleteTexture(location); + IResource iresource = Minecraft.getMinecraft().getResourceManager().getResource(location); inputstream = iresource.getInputStream(); @@ -355,15 +363,14 @@ public class RenderNPCInterface extends RenderLiving{ int totalWidth = bufferedimage.getWidth(); int totalHeight = bufferedimage.getHeight(); - if (totalHeight > 32) { + if (totalHeight > 32 && npc.display.modelType == 0) { bufferedimage = bufferedimage.getSubimage(0, 0, totalWidth, 32); - - TextureManager texturemanager = Minecraft.getMinecraft().getTextureManager(); - ImageDownloadAlt object = new ImageDownloadAlt(null, npc.display.texture, SkinManager.field_152793_a, new ImageBufferDownloadAlt(false)); - object.setBufferedImage(bufferedimage); - texturemanager.loadTexture(location, object); } + ImageDownloadAlt object = new ImageDownloadAlt(null, npc.display.texture, SkinManager.field_152793_a, new ImageBufferDownloadAlt(false)); + object.setBufferedImage(bufferedimage); + texturemanager.loadTexture(location, object); + return location; } finally { if (inputstream != null) { diff --git a/src/main/java/noppes/npcs/entity/EntityNPCInterface.java b/src/main/java/noppes/npcs/entity/EntityNPCInterface.java index 9f7719377..904b11d15 100644 --- a/src/main/java/noppes/npcs/entity/EntityNPCInterface.java +++ b/src/main/java/noppes/npcs/entity/EntityNPCInterface.java @@ -128,7 +128,6 @@ public abstract class EntityNPCInterface extends EntityCreature implements IEnti public List interactingEntities = new ArrayList(); public ResourceLocation textureLocation = null; - public ResourceLocation textureGlowLocation = null; public ResourceLocation textureCloakLocation = null; public EnumAnimation currentAnimation = EnumAnimation.NONE;