diff options
-rw-r--r-- | CHANGELOG.md | 4 | ||||
-rw-r--r-- | FEATURES.md | 4 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java | 2 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/config/Features.java | 4 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/config/features/Bingo.java | 14 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/config/features/Chat.java | 7 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/CompactBingoChat.kt | 112 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/CompactSplashPotionMessage.kt | 35 |
8 files changed, 180 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 4eac20119..72210d27a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,10 +4,12 @@ ### Features + Added /shtrackcollection <item> - This tracks the number of items you collect, but it does not work with sacks. ++ Added Compact Bingo Chat Messages ++ Added Compact Potion Effect Chat Messages ### Changes + Don't render overlays when tab list key is pressed. -+ No longer blocking the sell of bazaar items to NPC when on ironman, stranded or bingo mode. ++ Do no longer prevent the selling of bazaar items to NPC when on ironman, stranded or bingo mode. ### Fixes + Dungeon level color fixed wrong colors. diff --git a/FEATURES.md b/FEATURES.md index 7f44a497d..9687098b0 100644 --- a/FEATURES.md +++ b/FEATURES.md @@ -19,6 +19,7 @@ - Option to hide the death messages of other players, except for players who are close to the player, inside the dungeon or during a Kuudra fight. - 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 ## Dungeon - Clicked Blocks (Showing the block behind walls AFTER clicked on a chest, wither essence or a lever) @@ -137,6 +138,9 @@ + Highlight marked player names in chat. + Mark the own player name. +## Bingo ++ Shortens chat messages about skill level ups, collection gains, new area discoveries, and bestiarity upgrades while on bingo. + ## Commands - /wiki (using hypixel-skyblock.fandom.com instead of Hypixel wiki) - /shmarkplayer <player> (marking a player with yellow color) diff --git a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java index 5a1e9fb7c..d7670e810 100644 --- a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java +++ b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java @@ -167,7 +167,9 @@ public class SkyHanniMod { registerEvent(new HighlightBonzoMasks()); registerEvent(new DungeonLevelColor()); registerEvent(new BazaarCancelledBuyOrderClipboard()); + registerEvent(new CompactSplashPotionMessage()); registerEvent(new CroesusUnopenedChestTracker()); + registerEvent(new CompactBingoChat()); Commands.INSTANCE.init(); diff --git a/src/main/java/at/hannibal2/skyhanni/config/Features.java b/src/main/java/at/hannibal2/skyhanni/config/Features.java index 976a0d9da..083220b29 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/Features.java +++ b/src/main/java/at/hannibal2/skyhanni/config/Features.java @@ -165,6 +165,10 @@ public class Features extends Config { public MarkedPlayers markedPlayers = new MarkedPlayers(); @Expose + @Category(name = "Bingo", desc = "Features for the Bingo mode.") + public Bingo bingo = new Bingo(); + + @Expose @Category(name = "Misc", desc = "Settings without a category.") public Misc misc = new Misc(); diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/Bingo.java b/src/main/java/at/hannibal2/skyhanni/config/features/Bingo.java new file mode 100644 index 000000000..002841d22 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/config/features/Bingo.java @@ -0,0 +1,14 @@ +package at.hannibal2.skyhanni.config.features; + +import at.hannibal2.skyhanni.config.core.config.annotations.ConfigEditorBoolean; +import at.hannibal2.skyhanni.config.core.config.annotations.ConfigOption; +import com.google.gson.annotations.Expose; + +public class Bingo { + + @Expose + @ConfigOption(name = "Compact Chat Messages", desc = "Shortens chat messages about skill level ups, collection gains, " + + "new area discoveries, and bestiarity upgrades while on bingo.") + @ConfigEditorBoolean + public boolean compactChatMessages = true; +} 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 029731f96..386a8fd4b 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/Chat.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/Chat.java @@ -91,7 +91,7 @@ public class Chat { @Expose @ConfigOption(name = "Dungeon Filter", desc = "Hide annoying messages in the dungeon.") @ConfigEditorBoolean - public boolean dungeonMessages = false; + public boolean dungeonMessages = true; @Expose @ConfigOption(name = "Dungeon Boss Messages", desc = "Hide messages from watcher and bosses in the dungeon.") @@ -103,4 +103,9 @@ public class Chat { "except for players who are close to the player, inside dungeon or during a Kuudra fight.") @ConfigEditorBoolean public boolean hideFarDeathMessages = false; + + @Expose + @ConfigOption(name = "Compact Potion Message", desc = "Shorten chat messages about player potion effects.") + @ConfigEditorBoolean + public boolean compactPotionMessage = true; } diff --git a/src/main/java/at/hannibal2/skyhanni/features/CompactBingoChat.kt b/src/main/java/at/hannibal2/skyhanni/features/CompactBingoChat.kt new file mode 100644 index 000000000..236236bb6 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/CompactBingoChat.kt @@ -0,0 +1,112 @@ +package at.hannibal2.skyhanni.features + +import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.events.LorenzChatEvent +import at.hannibal2.skyhanni.utils.LorenzUtils +import at.hannibal2.skyhanni.utils.StringUtils.removeColor +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent + +class CompactBingoChat { + + private var blockedSkillLevelUp = false + private var blockedCollectionLevelUp = false + private var collectionLevelUpLastLine: String? = null + private var newArea = 0//0 = nothing, 1 = after first message, 2 = after second message + private var blockedBestiarity = false + + @SubscribeEvent + fun onChatMessage(event: LorenzChatEvent) { + if (!LorenzUtils.isBingoProfile) return + if (!SkyHanniMod.feature.bingo.compactChatMessages) return + + onSkillLevelUp(event) + onCollectionLevelUp(event) + onNewAreaDiscovered(event) + onBestiarityUpgrade(event) + } + + private fun onSkillLevelUp(event: LorenzChatEvent) { + val message = event.message + if (message.startsWith(" §r§b§lSKILL LEVEL UP ")) { + blockedSkillLevelUp = true + return + } + if (message == "§3§l▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬") { + blockedSkillLevelUp = false + return + } + + if (blockedSkillLevelUp) { + if (!message.contains("Access to") && !message.endsWith(" Enchantment")) { + event.blockedReason = "compact skill level up" + } + } + } + + private fun onCollectionLevelUp(event: LorenzChatEvent) { + val message = event.message + if (message.startsWith(" §r§6§lCOLLECTION LEVEL UP ")) { + blockedCollectionLevelUp = true + return + } + if (message == "§e§l▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬") { + blockedCollectionLevelUp = false + return + } + + if (blockedCollectionLevelUp) { + if (message.contains("Trade") || message.contains("Recipe")) { + var text = message.removeColor().replace(" ", "") + if (text == "Trade" || text == "Recipe") { + collectionLevelUpLastLine?.let { LorenzUtils.chat(it) } + } + } else { + event.blockedReason = "compact collection level up" + collectionLevelUpLastLine = message + } + } + } + + private fun onNewAreaDiscovered(event: LorenzChatEvent) { + var message = event.message + + if (message == " §r§6§lNEW AREA DISCOVERED!") { + newArea = 1 + println("new area $newArea $message") + return + } + + if (message != "") { + if (newArea == 1) { + newArea = 2 + println("new area $newArea $message") + return + } + + if (newArea == 2) { + if (message.startsWith("§7 ■ §r") || message.startsWith(" §r")) { + event.blockedReason = "compact new area discovered" + } else { + newArea = 0 + println("new area $newArea $message") + } + } + } + } + + private fun onBestiarityUpgrade(event: LorenzChatEvent) { + val message = event.message + if (message.startsWith(" §r§3§lBESTIARY §b§l")) { + blockedBestiarity = true + return + } + if (message == "§3§l▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬") { + blockedBestiarity = false + return + } + + if (blockedBestiarity) { + event.blockedReason = "compact bestiarity upgrade" + } + } +}
\ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/CompactSplashPotionMessage.kt b/src/main/java/at/hannibal2/skyhanni/features/CompactSplashPotionMessage.kt new file mode 100644 index 000000000..04740bbbd --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/CompactSplashPotionMessage.kt @@ -0,0 +1,35 @@ +package at.hannibal2.skyhanni.features + +import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.events.LorenzChatEvent +import at.hannibal2.skyhanni.utils.LorenzUtils +import net.minecraft.util.ChatComponentText +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent +import java.util.regex.Pattern + +class CompactSplashPotionMessage { + + private val POTION_EFFECT_PATTERN = + Pattern.compile("§a§lBUFF! §fYou have gained §r(.*)§r§f! Press TAB or type /effects to view your active effects!") + + private val POTION_EFFECT_OTHERS_PATTERN = + Pattern.compile("§a§lBUFF! §fYou were splashed by (.*) §fwith §r(.*)§r§f! Press TAB or type /effects to view your active effects!") + + @SubscribeEvent + fun onChatMessage(event: LorenzChatEvent) { + if (!LorenzUtils.inSkyblock || !SkyHanniMod.feature.chat.compactPotionMessage) return + + var matcher = POTION_EFFECT_PATTERN.matcher(event.message) + if (matcher.matches()) { + val name = matcher.group(1) + event.chatComponent = ChatComponentText("§a§lPotion Effect! §r$name") + } + + matcher = POTION_EFFECT_OTHERS_PATTERN.matcher(event.message) + if (matcher.matches()) { + val playerName = matcher.group(1) + val effectName = matcher.group(2) + event.chatComponent = ChatComponentText("§a§lPotion Effect! §r$effectName §7(by $playerName§7)") + } + } +}
\ No newline at end of file |