diff options
author | kokoniara <70776766+kingstefan26@users.noreply.github.com> | 2022-10-07 14:50:22 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-07 21:50:22 +0900 |
commit | dd7a4209752715db544b2fef804da9762c532cdc (patch) | |
tree | 496c7bf318c8b047285aba0c5c695b2242e3a336 /src/main/java/kr/syeyoung/dungeonsguide/commands | |
parent | 95af42d0a671517bad21df43ba82e61cd64e5fba (diff) | |
download | Skyblock-Dungeons-Guide-dd7a4209752715db544b2fef804da9762c532cdc.tar.gz Skyblock-Dungeons-Guide-dd7a4209752715db544b2fef804da9762c532cdc.tar.bz2 Skyblock-Dungeons-Guide-dd7a4209752715db544b2fef804da9762c532cdc.zip |
fix player profile not never loading in chat (#63)
* fix player profile not never loading in chat
* cut out hychat like a cancer
* ApiFetchur now caches whole players not single profiles,
added a switch profile button in gui
* ugh git
* Revert "cut out hychat like a cancer"
This reverts commit 2ee11afa
* ugh git x2
* I tried, good luck maintaining this
* forgot to uncomment hychat fix
* now shows which profile is now selected
put button on top
a lil refactor
* fix player profile sometimes not loading
Co-authored-by: syeyoung <42869671+cyoung06@users.noreply.github.com>
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/commands')
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/commands/CommandDungeonsGuide.java | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/commands/CommandDungeonsGuide.java b/src/main/java/kr/syeyoung/dungeonsguide/commands/CommandDungeonsGuide.java index 50f5aa7f..95850fdc 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/commands/CommandDungeonsGuide.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/commands/CommandDungeonsGuide.java @@ -40,8 +40,8 @@ import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoomInfoRegistry; import kr.syeyoung.dungeonsguide.events.DungeonLeftEvent; import kr.syeyoung.dungeonsguide.features.AbstractFeature; import kr.syeyoung.dungeonsguide.features.FeatureRegistry; -import kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.FeatureViewPlayerOnJoin; -import kr.syeyoung.dungeonsguide.features.impl.party.api.ApiFetchur; +import kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.FeatureViewPlayerStatsOnJoin; +import kr.syeyoung.dungeonsguide.features.impl.party.playerpreview.api.ApiFetcher; import kr.syeyoung.dungeonsguide.roomedit.EditingContext; import kr.syeyoung.dungeonsguide.roomedit.gui.GuiDungeonRoomEdit; import kr.syeyoung.dungeonsguide.roomprocessor.GeneralRoomProcessor; @@ -270,17 +270,7 @@ public class CommandDungeonsGuide extends CommandBase { Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §cNot in Party")); return; } - for (String member : context.getPartyRawMembers()) { - ApiFetchur.fetchUUIDAsync(member) - .thenAccept(a -> { - if (a == null) { - Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §e"+member+"§f's Profile §cCouldn't fetch uuid")); - } else { - ApiFetchur.fetchMostRecentProfileAsync(a.get(), FeatureRegistry.PARTYKICKER_APIKEY.getAPIKey()); - Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §e" + member + "§f's Profile ").appendSibling(new ChatComponentText("§7view").setChatStyle(new ChatStyle().setChatHoverEvent(new FeatureViewPlayerOnJoin.HoverEventRenderPlayer(a.orElse(null)))))); - } - }); - } + FeatureViewPlayerStatsOnJoin.processPartyMembers(context); }); // } else if (args[0].equals("fixschematic")) { // File root = new File(e.getDungeonsGuide().getConfigDir(), "schematics"); @@ -388,15 +378,15 @@ public class CommandDungeonsGuide extends CommandBase { } } else if (args[0].equals("pv")) { try { - ApiFetchur.fetchUUIDAsync(args[1]) + ApiFetcher.fetchUUIDAsync(args[1]) .thenAccept(a -> { - sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §e" + args[1] + "§f's Profile ").appendSibling(new ChatComponentText("§7view").setChatStyle(new ChatStyle().setChatHoverEvent(new FeatureViewPlayerOnJoin.HoverEventRenderPlayer(a.orElse(null)))))); + sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §e" + args[1] + "§f's Profile ").appendSibling(new ChatComponentText("§7view").setChatStyle(new ChatStyle().setChatHoverEvent(new FeatureViewPlayerStatsOnJoin.HoverEventRenderPlayer(a.orElse(null)))))); }); } catch (Exception e) { e.printStackTrace(); } } else if (args[0].equals("purge")) { - ApiFetchur.purgeCache(); + ApiFetcher.purgeCache(); CosmeticsManager cosmeticsManager = DungeonsGuide.getDungeonsGuide().getCosmeticsManager(); cosmeticsManager.requestPerms(); cosmeticsManager.requestCosmeticsList(); |