diff options
author | Sychic <Sychic@github.com> | 2020-12-18 10:34:43 -0500 |
---|---|---|
committer | Sychic <Sychic@github.com> | 2020-12-18 10:34:43 -0500 |
commit | 20034c5391551471ab9d534002c1167dbe87aba4 (patch) | |
tree | b38334caea683c1660c831c02519b8b74542a394 | |
parent | 6baa9f89600d23e0b7265b0a30d6003b928bf4a0 (diff) | |
download | SkyblockMod-20034c5391551471ab9d534002c1167dbe87aba4.tar.gz SkyblockMod-20034c5391551471ab9d534002c1167dbe87aba4.tar.bz2 SkyblockMod-20034c5391551471ab9d534002c1167dbe87aba4.zip |
Separate partying thread to allow for it to wait separately from main thread.
-rw-r--r-- | src/main/java/me/Danker/commands/RepartyCommand.java | 16 |
1 files changed, 9 insertions, 7 deletions
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(); } } |