diff options
author | syeyoung <cyong06@naver.com> | 2021-05-08 20:24:13 +0900 |
---|---|---|
committer | syeyoung <cyong06@naver.com> | 2021-05-08 20:24:13 +0900 |
commit | 293bb4f9cd34a46c3b33997491b4b7927d0d9e70 (patch) | |
tree | 348fd50ffb959595f974ee1ac99d0294945403d7 /src/main/java/kr/syeyoung/dungeonsguide/features/impl/party | |
parent | 5d1d86dd5220b61707a57d12d0fa1dbb356d30e7 (diff) | |
download | Skyblock-Dungeons-Guide-293bb4f9cd34a46c3b33997491b4b7927d0d9e70.tar.gz Skyblock-Dungeons-Guide-293bb4f9cd34a46c3b33997491b4b7927d0d9e70.tar.bz2 Skyblock-Dungeons-Guide-293bb4f9cd34a46c3b33997491b4b7927d0d9e70.zip |
cosmetics.
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/features/impl/party')
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/FeatureViewPlayerOnJoin.java | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/FeatureViewPlayerOnJoin.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/FeatureViewPlayerOnJoin.java index 24c25642..2ee94226 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/FeatureViewPlayerOnJoin.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/playerpreview/FeatureViewPlayerOnJoin.java @@ -24,10 +24,13 @@ import com.mojang.authlib.minecraft.MinecraftProfileTexture; import io.github.moulberry.hychat.HyChat; import io.github.moulberry.hychat.chat.ChatManager; import io.github.moulberry.hychat.gui.GuiChatBox; +import kr.syeyoung.dungeonsguide.DungeonsGuide; import kr.syeyoung.dungeonsguide.config.guiconfig.ConfigPanelCreator; import kr.syeyoung.dungeonsguide.config.guiconfig.FeatureEditPane; import kr.syeyoung.dungeonsguide.config.guiconfig.GuiConfig; import kr.syeyoung.dungeonsguide.config.guiconfig.PanelDefaultParameterConfig; +import kr.syeyoung.dungeonsguide.cosmetics.ActiveCosmetic; +import kr.syeyoung.dungeonsguide.cosmetics.CosmeticData; import kr.syeyoung.dungeonsguide.features.FeatureParameter; import kr.syeyoung.dungeonsguide.features.FeatureRegistry; import kr.syeyoung.dungeonsguide.features.SimpleFeature; @@ -245,7 +248,23 @@ public class FeatureViewPlayerOnJoin extends SimpleFeature implements GuiPostRen GlStateManager.color(1, 1, 1, 1.0F); if (fakePlayer != null) { GuiInventory.drawEntityOnScreen(45, 150, 60, -(mouseX - popupRect.x - 75), 0, fakePlayer); - fr.drawString(fakePlayer.getName(), (90 - fr.getStringWidth(fakePlayer.getName())) / 2, 15, 0xFFEFFF00); + + String toDraw = fakePlayer.getName(); + List<ActiveCosmetic> activeCosmetics = DungeonsGuide.getDungeonsGuide().getCosmeticsManager().getActiveCosmeticByPlayer().get(UUID.fromString(TextUtils.insertDashUUID(playerProfile.get().getMemberUID()))); + CosmeticData prefix = null, color = null; + if (activeCosmetics != null) { + for (ActiveCosmetic activeCosmetic : activeCosmetics) { + CosmeticData cosmeticData = DungeonsGuide.getDungeonsGuide().getCosmeticsManager().getCosmeticDataMap().get(activeCosmetic.getCosmeticData()); + if (cosmeticData != null) { + if (cosmeticData.getCosmeticType().equals("prefix")) prefix = cosmeticData; + if (cosmeticData.getCosmeticType().equals("color")) color = cosmeticData; + } + } + } + toDraw = (color == null ? "§e" : color.getData().replace("&", "§"))+toDraw; + if (prefix != null) toDraw = prefix.getData().replace("&", "§") + " "+toDraw; + + fr.drawString(toDraw, (90 - fr.getStringWidth(toDraw)) / 2, 15, -1); ItemStack toHover = null; if (relX > 20 && relX < 70) { |