From 3f534ee004d91c3cd9f5d150dae21621c4f5ba28 Mon Sep 17 00:00:00 2001 From: Kam Date: Wed, 15 Nov 2023 22:55:15 -0500 Subject: [PATCH] URLs on Cloaks --- src/main/java/noppes/npcs/DataDisplay.java | 1 - src/main/java/noppes/npcs/client/EntityUtil.java | 1 - .../npcs/client/gui/GuiNpcTextureCloaks.java | 1 - .../npcs/client/gui/mainmenu/GuiNpcDisplay.java | 3 --- .../java/noppes/npcs/client/model/ModelMPM.java | 11 ++++++++--- .../noppes/npcs/entity/EntityNPCInterface.java | 1 - .../customnpcs/textures/cloak/CobaltRevamp.png | Bin 0 -> 399 bytes 7 files changed, 8 insertions(+), 10 deletions(-) create mode 100644 src/main/resources/assets/customnpcs/textures/cloak/CobaltRevamp.png diff --git a/src/main/java/noppes/npcs/DataDisplay.java b/src/main/java/noppes/npcs/DataDisplay.java index 7fe58cd65..565b4bbbe 100644 --- a/src/main/java/noppes/npcs/DataDisplay.java +++ b/src/main/java/noppes/npcs/DataDisplay.java @@ -195,7 +195,6 @@ public class DataDisplay { if(prevSkinType != skinType || !texture.equals(prevTexture)) npc.textureLocation = 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 b2a283205..05954bce4 100644 --- a/src/main/java/noppes/npcs/client/EntityUtil.java +++ b/src/main/java/noppes/npcs/client/EntityUtil.java @@ -89,7 +89,6 @@ public class EntityUtil { EntityNPCInterface target = (EntityNPCInterface) entity; target.textureLocation = npc.textureLocation; - target.textureCloakLocation = npc.textureCloakLocation; target.display = npc.display; target.inventory = npc.inventory; diff --git a/src/main/java/noppes/npcs/client/gui/GuiNpcTextureCloaks.java b/src/main/java/noppes/npcs/client/gui/GuiNpcTextureCloaks.java index 35e50c53a..8c4221175 100644 --- a/src/main/java/noppes/npcs/client/gui/GuiNpcTextureCloaks.java +++ b/src/main/java/noppes/npcs/client/gui/GuiNpcTextureCloaks.java @@ -74,7 +74,6 @@ public class GuiNpcTextureCloaks extends GuiNpcSelectionInterface public void elementClicked(){ if(dataTextures.contains(slot.selected) && slot.selected != null){ npc.display.cloakTexture = assets.getAsset(slot.selected); - npc.textureCloakLocation = null; } } 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 c52db6541..6ffbbae45 100644 --- a/src/main/java/noppes/npcs/client/gui/mainmenu/GuiNpcDisplay.java +++ b/src/main/java/noppes/npcs/client/gui/mainmenu/GuiNpcDisplay.java @@ -124,12 +124,9 @@ public class GuiNpcDisplay extends GuiNPCInterface2 implements ITextfieldListene display.texture = textfield.getText(); } else if(textfield.id == 8){ - npc.textureCloakLocation = null; display.cloakTexture = textfield.getText(); } else if(textfield.id == 9){ - //npc.textureGlowLocation = null; - //display.glowTexture = textfield.getText(); if (!textfield.getText().isEmpty()) { npc.display.skinOverlayData.overlayList.put(0,new SkinOverlay(textfield.getText())); } else { diff --git a/src/main/java/noppes/npcs/client/model/ModelMPM.java b/src/main/java/noppes/npcs/client/model/ModelMPM.java index c2b248e48..2084f08d2 100644 --- a/src/main/java/noppes/npcs/client/model/ModelMPM.java +++ b/src/main/java/noppes/npcs/client/model/ModelMPM.java @@ -934,10 +934,15 @@ public class ModelMPM extends ModelNPCMale{ public void renderCloak(EntityCustomNpc npc, float f){ if (!npc.display.cloakTexture.isEmpty() && !isArmor) { - if(npc.textureCloakLocation == null){ - npc.textureCloakLocation = new ResourceLocation(npc.display.cloakTexture); + ImageData imageData = ClientCacheHandler.getImageData(npc.display.cloakTexture); + if (!imageData.imageLoaded()) + return; + + try { + imageData.bindTexture(); + } catch (Exception e) { return; } - bindTexture((ResourceLocation) npc.textureCloakLocation); + GL11.glPushMatrix(); GL11.glTranslatef(0.0F, 0.0F, 0.125F); double d = (npc.field_20066_r + (npc.field_20063_u - npc.field_20066_r) * (double)f) - (npc.prevPosX + (npc.posX - npc.prevPosX) * (double)f); diff --git a/src/main/java/noppes/npcs/entity/EntityNPCInterface.java b/src/main/java/noppes/npcs/entity/EntityNPCInterface.java index e12b550ce..19475dfb2 100644 --- a/src/main/java/noppes/npcs/entity/EntityNPCInterface.java +++ b/src/main/java/noppes/npcs/entity/EntityNPCInterface.java @@ -104,7 +104,6 @@ public abstract class EntityNPCInterface extends EntityCreature implements IEnti public List interactingEntities = new ArrayList(); public ResourceLocation textureLocation = null; - public ResourceLocation textureCloakLocation = null; public EnumAnimation currentAnimation = EnumAnimation.NONE; diff --git a/src/main/resources/assets/customnpcs/textures/cloak/CobaltRevamp.png b/src/main/resources/assets/customnpcs/textures/cloak/CobaltRevamp.png new file mode 100644 index 0000000000000000000000000000000000000000..01de5c1f96705125c3de6201bba5359b1569a7d6 GIT binary patch literal 399 zcmeAS@N?(olHy`uVBq!ia0vp^4nVBH!3-p)I`?e@QjEnx?oJHr&dIz4a#+$GeH|GX zHuiJ>Nn{1`)dPG&T=|4#rQ|eal?_ECRJ4uVlr_y$3R>rEI==eg?T#619X-MVqO*Z& zC&jJY45WBVg8YL2BLN267fNkFiMO6Ejv*f2Zzmt@JEFkjT*$;?_4oh#Saze`#WS2O z-YykeI#I{|QrDE-4pW4tL}f>>zE?T*6Z;R1!@eDwQ{6f@{R!Q{IrX0M;Z?V1WPdFX z{-hv$_!(0sN~$m_6!)6gt8PTZWG zqvf?g!egd&i7X$uEFAc)CG-zwSFqozP+ua;=wiirru^YUX$DSnMJ5NP&pB}cvH|@J zYa3afJ^a4Y>**x1JSUbdf1h7-cvEP@^n>U3M!TbD^c<{bq_e-d5;of==gbmQ+44$rjF6*2UngCw>o~-}? literal 0 HcmV?d00001