aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/Danker/commands
diff options
context:
space:
mode:
authorSychic <Sychic@github.com>2020-12-19 15:37:39 -0500
committerSychic <Sychic@github.com>2020-12-19 15:37:39 -0500
commit7777fe8a544a347013c4790e16b061eca5b5e0de (patch)
treef98544548019bde3dacd9913d9b1159d88164e35 /src/main/java/me/Danker/commands
parent2ea0943f42c428aa946f5163083a891529657f41 (diff)
downloadSkyblockMod-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')
-rw-r--r--src/main/java/me/Danker/commands/SetPartyCommand.java20
-rw-r--r--src/main/java/me/Danker/commands/SetkeyCommand.java1
2 files changed, 20 insertions, 1 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();
+ }
}
diff --git a/src/main/java/me/Danker/commands/SetkeyCommand.java b/src/main/java/me/Danker/commands/SetkeyCommand.java
index db5fb9a..ee4b5a5 100644
--- a/src/main/java/me/Danker/commands/SetkeyCommand.java
+++ b/src/main/java/me/Danker/commands/SetkeyCommand.java
@@ -38,5 +38,4 @@ public class SetkeyCommand extends CommandBase implements ICommand {
ConfigHandler.writeStringConfig("api", "APIKey", arg1[0]);
player.addChatMessage(new ChatComponentText(DankersSkyblockMod.MAIN_COLOUR + "Set API key to " + DankersSkyblockMod.SECONDARY_COLOUR + arg1[0]));
}
-
}