aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/de/hysky/skyblocker/utils
diff options
context:
space:
mode:
authorAaron <51387595+AzureAaron@users.noreply.github.com>2023-10-26 00:32:54 -0400
committerGitHub <noreply@github.com>2023-10-26 00:32:54 -0400
commit0aa9d8babe79ac2c5f3d811932e68ec460766bf9 (patch)
treeb39dfabd7df560eeef57af8449a0563a1f85ae12 /src/main/java/de/hysky/skyblocker/utils
parentfe1f8bc4c660c37e21db11bdb4c6d6f8cc5b6986 (diff)
parent1a8465eae0e1d212c8f36eacae173a12cf7ec014 (diff)
downloadSkyblocker-0aa9d8babe79ac2c5f3d811932e68ec460766bf9.tar.gz
Skyblocker-0aa9d8babe79ac2c5f3d811932e68ec460766bf9.tar.bz2
Skyblocker-0aa9d8babe79ac2c5f3d811932e68ec460766bf9.zip
Merge pull request #387 from kevinthegreat1/backpack-background
Refactor Backpack Preview
Diffstat (limited to 'src/main/java/de/hysky/skyblocker/utils')
-rw-r--r--src/main/java/de/hysky/skyblocker/utils/Utils.java24
1 files changed, 21 insertions, 3 deletions
diff --git a/src/main/java/de/hysky/skyblocker/utils/Utils.java b/src/main/java/de/hysky/skyblocker/utils/Utils.java
index bbfd1101..1205c71b 100644
--- a/src/main/java/de/hysky/skyblocker/utils/Utils.java
+++ b/src/main/java/de/hysky/skyblocker/utils/Utils.java
@@ -38,11 +38,19 @@ public class Utils {
private static boolean isInDungeons = false;
private static boolean isInjected = false;
/**
- * The following fields store data returned from /locraw: {@link #profile}, {@link #server}, {@link #gameType}, {@link #locationRaw}, and {@link #map}.
+ * The profile name parsed from the player list.
*/
- @SuppressWarnings("JavadocDeclaration")
@NotNull
private static String profile = "";
+ /**
+ * The profile id parsed from the chat.
+ */
+ @NotNull
+ private static String profileId = "";
+ /**
+ * The following fields store data returned from /locraw: {@link #server}, {@link #gameType}, {@link #locationRaw}, and {@link #map}.
+ */
+ @SuppressWarnings("JavadocDeclaration")
@NotNull
private static String server = "";
@NotNull
@@ -89,6 +97,11 @@ public class Utils {
return profile;
}
+ @NotNull
+ public static String getProfileId() {
+ return profileId;
+ }
+
/**
* @return the server parsed from /locraw.
*/
@@ -323,7 +336,7 @@ public class Utils {
}
/**
- * Parses the /locraw reply from the server
+ * Parses the /locraw reply from the server and updates the player's profile id
*
* @return not display the message in chat is the command is sent by the mod
*/
@@ -349,6 +362,11 @@ public class Utils {
return shouldFilter;
}
}
+
+ if (isOnSkyblock && message.startsWith("Profile ID: ")) {
+ profileId = message.replace("Profile ID: ", "");
+ }
+
return true;
}