From 20034c5391551471ab9d534002c1167dbe87aba4 Mon Sep 17 00:00:00 2001 From: Sychic Date: Fri, 18 Dec 2020 10:34:43 -0500 Subject: Separate partying thread to allow for it to wait separately from main thread. --- src/main/java/me/Danker/commands/RepartyCommand.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/main/java/me/Danker/commands/RepartyCommand.java') diff --git a/src/main/java/me/Danker/commands/RepartyCommand.java b/src/main/java/me/Danker/commands/RepartyCommand.java index 1658298..d3ac7f0 100644 --- a/src/main/java/me/Danker/commands/RepartyCommand.java +++ b/src/main/java/me/Danker/commands/RepartyCommand.java @@ -46,13 +46,15 @@ public class RepartyCommand extends CommandBase implements ICommand { Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(DankersSkyblockMod.ERROR_COLOUR + "Party unset! use " + SetPartyCommand.getUsage())); return; } - try{ - Minecraft.getMinecraft().thePlayer.sendChatMessage("/p disband"); - Thread.sleep(210); - Minecraft.getMinecraft().thePlayer.sendChatMessage("/p " + String.join(" ",players)); - } catch (InterruptedException e) { - e.printStackTrace(); - } + (new Thread(() -> { + try{ + Minecraft.getMinecraft().thePlayer.sendChatMessage("/p disband"); + Thread.sleep(210); + Minecraft.getMinecraft().thePlayer.sendChatMessage("/p " + String.join(" ",players)); + } catch (InterruptedException e) { + e.printStackTrace(); + } + })).start(); } } -- cgit