diff options
author | HacktheTime <l4bg0jb7@duck.com> | 2023-10-12 20:17:28 +0200 |
---|---|---|
committer | HacktheTime <l4bg0jb7@duck.com> | 2023-10-12 20:17:28 +0200 |
commit | dba4a297e295d68980da31264b0069fe9b18a13e (patch) | |
tree | c7e0a99968ef34509037f969ab7b1beba04a996d /src/main/java/de/hype/bbsentials/client/SplashManager.java | |
parent | e111619d66346a2309b86a00420681f4cddf3cea (diff) | |
download | BBsentials-dba4a297e295d68980da31264b0069fe9b18a13e.tar.gz BBsentials-dba4a297e295d68980da31264b0069fe9b18a13e.tar.bz2 BBsentials-dba4a297e295d68980da31264b0069fe9b18a13e.zip |
preperations to have a common code and different implementations for forge and fabric to ease up maintaining both versions
Diffstat (limited to 'src/main/java/de/hype/bbsentials/client/SplashManager.java')
-rw-r--r-- | src/main/java/de/hype/bbsentials/client/SplashManager.java | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/src/main/java/de/hype/bbsentials/client/SplashManager.java b/src/main/java/de/hype/bbsentials/client/SplashManager.java deleted file mode 100644 index aafec8e..0000000 --- a/src/main/java/de/hype/bbsentials/client/SplashManager.java +++ /dev/null @@ -1,58 +0,0 @@ -package de.hype.bbsentials.client; - -import de.hype.bbsentials.chat.Chat; -import de.hype.bbsentials.constants.enviromentShared.Islands; -import de.hype.bbsentials.packets.packets.SplashNotifyPacket; -import de.hype.bbsentials.packets.packets.SplashUpdatePacket; - -import java.util.HashMap; -import java.util.Map; - -public class SplashManager { - public static Map<Integer, DisplaySplash> splashPool = new HashMap<>(); - - public SplashManager() { - - } - - public static void addSplash(SplashNotifyPacket packet) { - splashPool.put(packet.splashId, new DisplaySplash(packet)); - } - - public static void updateSplash(SplashUpdatePacket packet) { - DisplaySplash splash = splashPool.get(packet.splashId); - if (splash != null) { - if (splash.alreadyDisplayed) { - if (BBsentials.config.showSplashStatusUpdates) { - Chat.sendPrivateMessageToSelfImportantInfo(splash.hubType.getDisplayName() + " #" + splash.hub + " is " + packet.status); - } - } - else { - splashPool.remove(splash.splashId); - } - } - } - - public static void display(int splashId) { - SplashNotifyPacket splash = splashPool.get(splashId); - if (splash == null) return; - String where; - if (splash.hubType.equals(Islands.DUNGEON_HUB)) { - where = "§5DUNGEON HUB§6"; - } - else { - where = "Hub"; - } - BBsentials.connection.splashHighlightItem("HUB #" + splash.hub, 20); - Chat.sendPrivateMessageToSelfImportantInfo(splash.splasherUsername + " is Splashing in " + where + " #" + splash.hub + " at " + splash.location + ":" + splash.extraMessage); - } - - private static class DisplaySplash extends SplashNotifyPacket { - public boolean alreadyDisplayed; - - public DisplaySplash(SplashNotifyPacket packet) { - super(packet.splashId, packet.hub, packet.splasherUsername, packet.location, packet.hubType, packet.extraMessage, packet.lessWaste); - alreadyDisplayed = false; - } - } -} |