aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/de/hysky/skyblocker/events/SkyblockEvents.java
diff options
context:
space:
mode:
authorviciscat <51047087+viciscat@users.noreply.github.com>2024-07-04 01:03:45 +0200
committerviciscat <51047087+viciscat@users.noreply.github.com>2024-07-04 01:03:45 +0200
commitac61fe9c8166dc1fdc0dbd0f3bca3a8a0f5fb02a (patch)
tree5b13457849286f1dde37505cbe6b2806832735b4 /src/main/java/de/hysky/skyblocker/events/SkyblockEvents.java
parent19e0fb096e427da5921009e8315aa0ac093b70ae (diff)
downloadSkyblocker-ac61fe9c8166dc1fdc0dbd0f3bca3a8a0f5fb02a.tar.gz
Skyblocker-ac61fe9c8166dc1fdc0dbd0f3bca3a8a0f5fb02a.tar.bz2
Skyblocker-ac61fe9c8166dc1fdc0dbd0f3bca3a8a0f5fb02a.zip
mhm
Diffstat (limited to 'src/main/java/de/hysky/skyblocker/events/SkyblockEvents.java')
-rw-r--r--src/main/java/de/hysky/skyblocker/events/SkyblockEvents.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/main/java/de/hysky/skyblocker/events/SkyblockEvents.java b/src/main/java/de/hysky/skyblocker/events/SkyblockEvents.java
index c268103d..93426143 100644
--- a/src/main/java/de/hysky/skyblocker/events/SkyblockEvents.java
+++ b/src/main/java/de/hysky/skyblocker/events/SkyblockEvents.java
@@ -26,6 +26,16 @@ public final class SkyblockEvents {
}
});
+ /**
+ * Called when the player's Skyblock profile changes.
+ * @implNote This is called upon receiving the chat message for the profile change rather than the exact moment of profile change, so it may be delayed by a few seconds.
+ */
+ public static final Event<ProfileChange> PROFILE_CHANGE = EventFactory.createArrayBacked(ProfileChange.class, callbacks -> (prev, profile) -> {
+ for (ProfileChange callback : callbacks) {
+ callback.onSkyblockProfileChange(prev, profile);
+ }
+ });
+
@Environment(EnvType.CLIENT)
@FunctionalInterface
public interface SkyblockJoin {
@@ -43,4 +53,10 @@ public final class SkyblockEvents {
public interface SkyblockLocationChange {
void onSkyblockLocationChange(Location location);
}
+
+ @Environment(EnvType.CLIENT)
+ @FunctionalInterface
+ public interface ProfileChange {
+ void onSkyblockProfileChange(String prevProfileId, String profileId);
+ }
}