diff options
author | syeyoung <cyong06@naver.com> | 2021-05-08 23:55:44 +0900 |
---|---|---|
committer | syeyoung <cyong06@naver.com> | 2021-05-08 23:55:44 +0900 |
commit | 20e8dcb9bed36708f2d717efaa9c32477a9fcd8a (patch) | |
tree | 09f1b7d46a043dac87b362cfe3c72bd947b6190e /src/main/java/kr/syeyoung/dungeonsguide/features | |
parent | 5b2b5abf56d992de12900044ba8f003c1aadb10c (diff) | |
download | Skyblock-Dungeons-Guide-20e8dcb9bed36708f2d717efaa9c32477a9fcd8a.tar.gz Skyblock-Dungeons-Guide-20e8dcb9bed36708f2d717efaa9c32477a9fcd8a.tar.bz2 Skyblock-Dungeons-Guide-20e8dcb9bed36708f2d717efaa9c32477a9fcd8a.zip |
concurrency. Fix crashing or flashing related to cosmetics
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/features')
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/features/impl/cosmetics/PrefixSelectorGUI.java | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/cosmetics/PrefixSelectorGUI.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/cosmetics/PrefixSelectorGUI.java index eca6228a..aa9f2f9b 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/cosmetics/PrefixSelectorGUI.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/cosmetics/PrefixSelectorGUI.java @@ -30,10 +30,8 @@ import net.minecraft.client.gui.Gui; import net.minecraft.client.renderer.GlStateManager; import java.awt.*; -import java.util.ArrayList; +import java.util.*; import java.util.List; -import java.util.Set; -import java.util.UUID; import java.util.function.Function; import java.util.stream.Collectors; @@ -79,7 +77,13 @@ public class PrefixSelectorGUI extends MPanel { FontRenderer fr = Minecraft.getMinecraft().fontRendererObj; CosmeticsManager cosmeticsManager = DungeonsGuide.getDungeonsGuide().getCosmeticsManager(); - Set<UUID> activeCosmeticList = cosmeticsManager.getActiveCosmeticByPlayer().computeIfAbsent(Minecraft.getMinecraft().thePlayer.getGameProfile().getId(), (a) -> new ArrayList<>()).stream().map(ActiveCosmetic::getCosmeticData).collect(Collectors.toSet()); + List<ActiveCosmetic> activeCosmeticList2 = cosmeticsManager.getActiveCosmeticByPlayer().get(Minecraft.getMinecraft().thePlayer.getGameProfile().getId()); + Set<UUID> activeCosmeticList = new HashSet<>(); + if (activeCosmeticList2 !=null) { + for (ActiveCosmetic activeCosmetic : activeCosmeticList2) { + activeCosmeticList.add(activeCosmetic.getCosmeticData()); + } + } |