diff options
author | Sychic <Sychic@github.com> | 2020-12-19 15:37:39 -0500 |
---|---|---|
committer | Sychic <Sychic@github.com> | 2020-12-19 15:37:39 -0500 |
commit | 7777fe8a544a347013c4790e16b061eca5b5e0de (patch) | |
tree | f98544548019bde3dacd9913d9b1159d88164e35 /src/main/java/me/Danker/commands/SetPartyCommand.java | |
parent | 2ea0943f42c428aa946f5163083a891529657f41 (diff) | |
download | SkyblockMod-7777fe8a544a347013c4790e16b061eca5b5e0de.tar.gz SkyblockMod-7777fe8a544a347013c4790e16b061eca5b5e0de.tar.bz2 SkyblockMod-7777fe8a544a347013c4790e16b061eca5b5e0de.zip |
Grab party with a button. Manual command still works, this just grabs from the current party.
Diffstat (limited to 'src/main/java/me/Danker/commands/SetPartyCommand.java')
-rw-r--r-- | src/main/java/me/Danker/commands/SetPartyCommand.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/main/java/me/Danker/commands/SetPartyCommand.java b/src/main/java/me/Danker/commands/SetPartyCommand.java index f840527..40551d3 100644 --- a/src/main/java/me/Danker/commands/SetPartyCommand.java +++ b/src/main/java/me/Danker/commands/SetPartyCommand.java @@ -10,9 +10,14 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; +import java.util.Arrays; + public class SetPartyCommand extends CommandBase implements ICommand { public static boolean set = false; + public static int delimiter = 0; + public static boolean gettingParty; + public static String partyResponse = ""; @Override public String getCommandName() { return "setparty"; } @@ -43,4 +48,19 @@ public class SetPartyCommand extends CommandBase implements ICommand { set = true; } + + public static void getParty() { + gettingParty = true; + partyResponse = ""; + Minecraft.getMinecraft().thePlayer.sendChatMessage("/pl"); + (new Thread(() ->{ + try{ + Thread.sleep(500); + RepartyCommand.players = Arrays.stream(partyResponse.split(" ")).filter(e -> !e.contains("[") && !e.contains("●")).toArray(String[]::new); + set = true; + } catch (InterruptedException e) { + e.printStackTrace(); + } + })).start(); + } } |