diff options
author | syeyoung <cyong06@naver.com> | 2021-07-17 23:53:01 +0900 |
---|---|---|
committer | syeyoung <cyong06@naver.com> | 2021-07-17 23:53:01 +0900 |
commit | 5534c9366b17b30a9c90722403acb58c5c09aa1b (patch) | |
tree | b2383b02398238c5b3a72095ad7498ef86c20067 /src/main/java/kr/syeyoung/dungeonsguide/cosmetics | |
parent | 872e0fa5e3d7b0271f6aa02ce69d4285e651838e (diff) | |
download | Skyblock-Dungeons-Guide-5534c9366b17b30a9c90722403acb58c5c09aa1b.tar.gz Skyblock-Dungeons-Guide-5534c9366b17b30a9c90722403acb58c5c09aa1b.tar.bz2 Skyblock-Dungeons-Guide-5534c9366b17b30a9c90722403acb58c5c09aa1b.zip |
Fix party manager to use cooldown
Fix Cosmetics removing player's messages
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/cosmetics')
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/cosmetics/CosmeticsManager.java | 18 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/cosmetics/chatreplacers/ChatReplacerViewProfile.java | 2 |
2 files changed, 12 insertions, 8 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/cosmetics/CosmeticsManager.java b/src/main/java/kr/syeyoung/dungeonsguide/cosmetics/CosmeticsManager.java index f208ac74..f6a9c3da 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/cosmetics/CosmeticsManager.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/cosmetics/CosmeticsManager.java @@ -234,7 +234,7 @@ public class CosmeticsManager implements StompMessageHandler { requestPerms(); } @Getter @Setter - private static Set<IChatReplacer> iChatReplacers = new HashSet<>(); + private static List<IChatReplacer> iChatReplacers = new ArrayList<>(); static { iChatReplacers.add(new ChatReplacerViewProfile()); iChatReplacers.add(new ChatReplacerSocialOptions()); @@ -245,13 +245,17 @@ public class CosmeticsManager implements StompMessageHandler { @SubscribeEvent(priority = EventPriority.LOWEST) public void onChat(ClientChatReceivedEvent clientChatReceivedEvent) { - if (clientChatReceivedEvent.type == 2) return; - for (IChatReplacer iChatReplacer : iChatReplacers) { - if (iChatReplacer.isAcceptable(clientChatReceivedEvent)) { - System.out.println("Chosen "+iChatReplacer); - iChatReplacer.translate(clientChatReceivedEvent, this); - return; + try { + if (clientChatReceivedEvent.type == 2) return; + for (IChatReplacer iChatReplacer : iChatReplacers) { + if (iChatReplacer.isAcceptable(clientChatReceivedEvent)) { + iChatReplacer.translate(clientChatReceivedEvent, this); + return; + } } + } catch (Throwable t) { + System.out.println(clientChatReceivedEvent.message); + t.printStackTrace(); } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/cosmetics/chatreplacers/ChatReplacerViewProfile.java b/src/main/java/kr/syeyoung/dungeonsguide/cosmetics/chatreplacers/ChatReplacerViewProfile.java index abd399e3..51787951 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/cosmetics/chatreplacers/ChatReplacerViewProfile.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/cosmetics/chatreplacers/ChatReplacerViewProfile.java @@ -35,7 +35,6 @@ import java.util.UUID; public class ChatReplacerViewProfile implements IChatReplacer { @Override public boolean isAcceptable(ClientChatReceivedEvent event) { - System.out.println(event.message); for (IChatComponent sibling : event.message.getSiblings()) { if (sibling.getChatStyle() != null && sibling.getChatStyle().getChatClickEvent() != null && sibling.getChatStyle().getChatClickEvent().getValue().startsWith("/viewprofile")) return true; } @@ -112,6 +111,7 @@ public class ChatReplacerViewProfile implements IChatReplacer { ChatComponentText newChatCompText = new ChatComponentText(building); newChatCompText.setChatStyle(sibling.getChatStyle()); replaceMents.add(new Tuple<>(sibling, newChatCompText)); + break; } } } |