From 28745d981c1ed2008d4ebb71b0b69ba217c1770d Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Mon, 19 Jun 2023 12:42:20 +0200 Subject: RNG Meter Display --- .../java/at/hannibal2/skyhanni/config/Storage.java | 20 +++++++++++++++- .../hannibal2/skyhanni/config/features/Slayer.java | 27 ++++++++++++++++++++++ 2 files changed, 46 insertions(+), 1 deletion(-) (limited to 'src/main/java/at/hannibal2/skyhanni/config') diff --git a/src/main/java/at/hannibal2/skyhanni/config/Storage.java b/src/main/java/at/hannibal2/skyhanni/config/Storage.java index 0a63e5928..ffac3b8ec 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/Storage.java +++ b/src/main/java/at/hannibal2/skyhanni/config/Storage.java @@ -5,7 +5,7 @@ import at.hannibal2.skyhanni.features.garden.CropAccessory; import at.hannibal2.skyhanni.features.garden.CropType; import at.hannibal2.skyhanni.features.garden.fortuneguide.FarmingItems; import at.hannibal2.skyhanni.features.garden.visitor.VisitorReward; -import at.hannibal2.skyhanni.features.misc.GhostCounter.Option; +import at.hannibal2.skyhanni.features.misc.GhostCounter.Option; import at.hannibal2.skyhanni.utils.LorenzVec; import com.google.gson.annotations.Expose; import net.minecraft.item.ItemStack; @@ -259,5 +259,23 @@ public class Storage { public boolean hidden; } } + + @Expose + public Map slayerRngMeter = new HashMap<>(); + + public static class SlayerRngMeterStorage { + + @Expose + public long currentMeter = -1; + + @Expose + public long gainPerBoss = -1; + + @Expose + public long goalNeeded = -1; + + @Expose + public String itemGoal = "?"; + } } } \ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/Slayer.java b/src/main/java/at/hannibal2/skyhanni/config/features/Slayer.java index 00392bcc4..852b54970 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/Slayer.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/Slayer.java @@ -143,6 +143,33 @@ public class Slayer { public int minimumPrice = 50_000; } + @Expose + @ConfigOption(name = "RNG Meter Display", desc = "") + @Accordion + public RngMeterDisplay rngMeterDisplay = new RngMeterDisplay(); + + public static class RngMeterDisplay { + + @Expose + @ConfigOption(name = "Enabled", desc = "Display amount of bosses needed until next rng meter drop.") + @ConfigEditorBoolean + public boolean enabled = true; + + @Expose + @ConfigOption(name = "Warn Empty", desc = "Warn when no item is set in the rng meter.") + @ConfigEditorBoolean + public boolean warnEmpty = false; + + @Expose + @ConfigOption(name = "Hide Chat", desc = "Hide the rng meter message from chat if current item is selected.") + @ConfigEditorBoolean + public boolean hideChat = true; + + @Expose + public Position pos = new Position(410, 110, false, true); + + } + @Expose @ConfigOption(name = "Broken Wither Impact", desc = "Warns when right-clicking with a Wither Impact weapon (e.g. Hyperion) no longer gains combat exp. " + -- cgit From 4c9b2f977bda0aef5a7e714553d534b60b1ce308 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Mon, 19 Jun 2023 12:44:25 +0200 Subject: Hide chat messages about the Arachne Fight while outside of Arachne's Sanctuary --- CHANGELOG.md | 1 + FEATURES.md | 1 + src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt | 2 + .../hannibal2/skyhanni/config/features/Chat.java | 7 ++- .../features/chat/ArachneChatMessageHider.kt | 50 ++++++++++++++++++++++ 5 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 src/main/java/at/hannibal2/skyhanni/features/chat/ArachneChatMessageHider.kt (limited to 'src/main/java/at/hannibal2/skyhanni/config') diff --git a/CHANGELOG.md b/CHANGELOG.md index 89b6f554e..b2fd4438b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,6 +44,7 @@ + Default disabled + Detects your SkyBlock Mod automatically + Does detect Chat Triggers and OneConfig itself, but no single mods that require these libraries ++ Added **Arachne Chat Hider** - Hide chat messages about the Arachne Fight while outside of Arachne's Sanctuary ### Changes + Added Options for displays Crop Milestone and Best Crop Time. diff --git a/FEATURES.md b/FEATURES.md index b6568d9bd..2089efb3f 100644 --- a/FEATURES.md +++ b/FEATURES.md @@ -20,6 +20,7 @@ - Scan messages sent by players in all-chat for blacklisted words and greys out the message. - Chat peeking (holding key to display chat without opening the chat gui) - Compact Potion Effect Messages +- **Arachne Chat Hider** - Hide chat messages about the Arachne Fight while outside of Arachne's Sanctuary ## Dungeon - Clicked Blocks (Showing the block behind walls AFTER clicked on a chest, wither essence or a lever) diff --git a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt index 0021299fa..ebe7d2686 100644 --- a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt +++ b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt @@ -12,6 +12,7 @@ import at.hannibal2.skyhanni.features.bazaar.BazaarBestSellMethod import at.hannibal2.skyhanni.features.bazaar.BazaarCancelledBuyOrderClipboard import at.hannibal2.skyhanni.features.bazaar.BazaarOrderHelper import at.hannibal2.skyhanni.features.bingo.* +import at.hannibal2.skyhanni.features.chat.ArachneChatMessageHider import at.hannibal2.skyhanni.features.chat.ChatFilter import at.hannibal2.skyhanni.features.chat.PlayerDeathMessages import at.hannibal2.skyhanni.features.chat.playerchat.PlayerChatFilter @@ -295,6 +296,7 @@ class SkyHanniMod { loadModule(DetectBrokenHyperion()) loadModule(RestorePieceOfWizardPortalLore()) loadModule(QuickModMenuSwitch) + loadModule(ArachneChatMessageHider()) loadModule(ShowItemUuid()) loadModule(SlayerRngMeterDisplay()) loadModule(GhostCounter) diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/Chat.java b/src/main/java/at/hannibal2/skyhanni/config/features/Chat.java index bd60e0eee..f149fc624 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/Chat.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/Chat.java @@ -122,10 +122,15 @@ public class Chat { "except for players who are nearby or during dungeons/a Kuudra fight.") @ConfigEditorBoolean public boolean hideFarDeathMessages = false; - //TODO jawbus + x + //TODO jawbus + thunder @Expose @ConfigOption(name = "Compact Potion Message", desc = "Shorten chat messages about player potion effects.") @ConfigEditorBoolean public boolean compactPotionMessage = true; + + @Expose + @ConfigOption(name = "Arachne Hider", desc = "Hide chat messages about the Arachne Fight while outside of §eArachne's Sanctuary§7.") + @ConfigEditorBoolean + public boolean hideArachneMessages = false; } diff --git a/src/main/java/at/hannibal2/skyhanni/features/chat/ArachneChatMessageHider.kt b/src/main/java/at/hannibal2/skyhanni/features/chat/ArachneChatMessageHider.kt new file mode 100644 index 000000000..d870197c7 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/chat/ArachneChatMessageHider.kt @@ -0,0 +1,50 @@ +package at.hannibal2.skyhanni.features.chat + +import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.data.IslandType +import at.hannibal2.skyhanni.events.LorenzChatEvent +import at.hannibal2.skyhanni.utils.LorenzUtils +import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent + +class ArachneChatMessageHider { + private val config get() = SkyHanniMod.feature.chat + private var hideArachneDeadMessage = false + private val arachneCallingPattern = "§4☄ §r.* §r§eplaced an §r§9Arachne's Calling§r§e!.*".toPattern() + private val arachneCrystalPattern = "§4☄ §r.* §r§eplaced an Arachne Crystal! Something is awakening!".toPattern() + + @SubscribeEvent + fun onChat(event: LorenzChatEvent) { + if (!isEnabled()) return + if (LorenzUtils.skyBlockIsland != IslandType.SPIDER_DEN) return + if (LorenzUtils.skyBlockArea == "Arachne's Sanctuary") return + + if (shouldHide(event.message)) { + event.blockedReason = "arachne" + } + } + + private fun shouldHide(message: String): Boolean { + + arachneCallingPattern.matchMatcher(message) { + return true + } + arachneCrystalPattern.matchMatcher(message) { + return true + } + + if (message == "§c[BOSS] Arachne§r§f: Ahhhh...A Calling...") return true + if (message == "§c[BOSS] Arachne§r§f: The Era of Spiders begins now.") return true + + if (message == "§a§l▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬") { + hideArachneDeadMessage = !hideArachneDeadMessage + return true + } + if (message == " §r§6§lARACHNE DOWN!") { + hideArachneDeadMessage = true + } + return hideArachneDeadMessage + } + + fun isEnabled() = LorenzUtils.inSkyBlock && config.hideArachneMessages +} -- cgit