From 7777fe8a544a347013c4790e16b061eca5b5e0de Mon Sep 17 00:00:00 2001 From: Sychic Date: Sat, 19 Dec 2020 15:37:39 -0500 Subject: Grab party with a button. Manual command still works, this just grabs from the current party. --- .../java/me/Danker/commands/SetPartyCommand.java | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/main/java/me/Danker/commands/SetPartyCommand.java') 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(); + } } -- cgit