aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorKevinthegreat <92656833+kevinthegreat1@users.noreply.github.com>2023-06-20 12:25:22 +0800
committerKevinthegreat <92656833+kevinthegreat1@users.noreply.github.com>2023-06-21 17:36:56 +0800
commitf7434efeae8f4ea0d193cdad11928f5a13eb6374 (patch)
tree8373f04176469756c59c7c5636ccffdf82dcd1e9 /src/main
parent8a5abeaec788dd5d17d8ddfb548a16fd2e8c5e43 (diff)
downloadSkyblocker-f7434efeae8f4ea0d193cdad11928f5a13eb6374.tar.gz
Skyblocker-f7434efeae8f4ea0d193cdad11928f5a13eb6374.tar.bz2
Skyblocker-f7434efeae8f4ea0d193cdad11928f5a13eb6374.zip
Add docs
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/me/xmrvizzy/skyblocker/discord/DiscordRPCManager.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/main/java/me/xmrvizzy/skyblocker/discord/DiscordRPCManager.java b/src/main/java/me/xmrvizzy/skyblocker/discord/DiscordRPCManager.java
index f7ec2f33..29a2c958 100644
--- a/src/main/java/me/xmrvizzy/skyblocker/discord/DiscordRPCManager.java
+++ b/src/main/java/me/xmrvizzy/skyblocker/discord/DiscordRPCManager.java
@@ -13,9 +13,15 @@ import org.slf4j.LoggerFactory;
import java.text.DecimalFormat;
import java.util.concurrent.CompletableFuture;
+/**
+ * Manages the discord rich presence. Automatically connects to discord and displays a customizable activity when playing Skyblock.
+ */
public class DiscordRPCManager {
public static final DecimalFormat DECIMAL_FORMAT = new DecimalFormat("###,###.##");
public static final Logger LOGGER = LoggerFactory.getLogger("Skyblocker Discord RPC");
+ /**
+ * The update task used to avoid multiple update tasks running simultaneously.
+ */
public static CompletableFuture<Void> updateTask;
public static long startTimeStamp;
public static int cycleCount;
@@ -28,6 +34,9 @@ public class DiscordRPCManager {
});
}
+ /**
+ * Checks the {@link SkyblockerConfig.RichPresence#customMessage custom message}, updates {@link #cycleCount} if enabled, and updates rich presence.
+ */
public static void updateDataAndPresence() {
// If the custom message is empty, discord will keep the last message, this is can serve as a default if the user doesn't want a custom message
if (SkyblockerConfig.get().richPresence.customMessage.isEmpty()) {
@@ -38,6 +47,9 @@ public class DiscordRPCManager {
initAndUpdatePresence();
}
+ /**
+ * @see #initAndUpdatePresence(boolean)
+ */
private static void initAndUpdatePresence() {
initAndUpdatePresence(false);
}