From bceb0858a8215dad1f70342035e26ac45b9d970d Mon Sep 17 00:00:00 2001 From: syeyoung Date: Sun, 18 Jul 2021 14:35:56 +0900 Subject: try and catch on party manager --- .../syeyoung/dungeonsguide/party/PartyManager.java | 32 +++++++++++++--------- 1 file changed, 19 insertions(+), 13 deletions(-) (limited to 'src/main/java/kr/syeyoung/dungeonsguide/party') diff --git a/src/main/java/kr/syeyoung/dungeonsguide/party/PartyManager.java b/src/main/java/kr/syeyoung/dungeonsguide/party/PartyManager.java index a01f1658..181d66cb 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/party/PartyManager.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/party/PartyManager.java @@ -360,25 +360,31 @@ public class PartyManager implements StompMessageHandler { } @SubscribeEvent public void onTick(TickEvent.ClientTickEvent clientTickEvent) { - if (clientTickEvent.phase == TickEvent.Phase.START && Minecraft.getMinecraft().thePlayer != null && minimumNext < System.currentTimeMillis() ) { - if (checkPlayer == 1) { - checkPlayer = -1; - sendChat.add(new Tuple<>("/pl", () -> {checkPlayer = 2;})); - } - if (!sendChat.isEmpty()) { - Tuple tuple = sendChat.poll(); - Minecraft.getMinecraft().thePlayer.sendChatMessage(tuple.getFirst()); - if (tuple.getSecond() != null) - tuple.getSecond().run(); - minimumNext = System.currentTimeMillis()+ 200; - DungeonsGuide.sendDebugChat(new ChatComponentText("Sending "+tuple.getFirst()+" Secretly")); + try { + if (clientTickEvent.phase == TickEvent.Phase.START && Minecraft.getMinecraft().thePlayer != null && minimumNext < System.currentTimeMillis()) { + if (checkPlayer == 1) { + checkPlayer = -1; + sendChat.add(new Tuple<>("/pl", () -> { + checkPlayer = 2; + })); + } + if (!sendChat.isEmpty()) { + Tuple tuple = sendChat.poll(); + Minecraft.getMinecraft().thePlayer.sendChatMessage(tuple.getFirst()); + if (tuple.getSecond() != null) + tuple.getSecond().run(); + minimumNext = System.currentTimeMillis() + 200; + DungeonsGuide.sendDebugChat(new ChatComponentText("Sending " + tuple.getFirst() + " Secretly")); + } } - + } catch (Throwable e) { + e.printStackTrace(); } } @SubscribeEvent public void onHypixelJoin(HypixelJoinedEvent skyblockJoinedEvent) { + minimumNext = System.currentTimeMillis() + 1000; sendChat.add(new Tuple<>("/pl", () -> {partyJoin = 1;})); } -- cgit