summaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/chat/CompactSplashPotionMessage.kt23
1 files changed, 8 insertions, 15 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/chat/CompactSplashPotionMessage.kt b/src/main/java/at/hannibal2/skyhanni/features/chat/CompactSplashPotionMessage.kt
index d9732079f..c823d83f0 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/chat/CompactSplashPotionMessage.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/chat/CompactSplashPotionMessage.kt
@@ -8,7 +8,7 @@ import at.hannibal2.skyhanni.utils.StringUtils.removeColor
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
class CompactSplashPotionMessage {
- private val config get() = SkyHanniMod.feature.chat
+ private val config get() = SkyHanniMod.feature.chat.compactPotionMessages
private val potionEffectPattern =
"§a§lBUFF! §fYou have gained §r(?<name>.*)§r§f! Press TAB or type /effects to view your active effects!".toPattern()
@@ -19,40 +19,33 @@ class CompactSplashPotionMessage {
@SubscribeEvent
fun onChatMessage(event: LorenzChatEvent) {
- if (!LorenzUtils.inSkyBlock || !config.compactPotionMessage) return
+ if (!LorenzUtils.inSkyBlock || !config.enabled) return
potionEffectPattern.matchMatcher(event.message) {
val name = group("name")
sendMessage("§a§lPotion Effect! §r$name")
- event.blockedReason = "blocked"
+ event.blockedReason = "compact_potion_effect"
}
potionSplashEffectOthersPattern.matchMatcher(event.message) {
val playerName = group("playerName").removeColor()
val effectName = group("effectName")
- sendMessage(
- "§a§lPotion Effect! §r$effectName by §b$playerName",
- )
- event.blockedReason = "blocked"
+ sendMessage("§a§lPotion Effect! §r$effectName by §b$playerName")
+ event.blockedReason = "compact_potion_effect"
}
potionSplashEffectPattern.matchMatcher(event.message) {
val name = group("name")
sendMessage("§a§lPotion Effect! §r$name")
- event.blockedReason = "blocked"
+ event.blockedReason = "compact_potion_effect"
}
}
private fun sendMessage(message: String) {
- if (config.compactPotionClickableMessage) {
- LorenzUtils.hoverableChat(
- message,
- listOf("§eClick to view your potion effects."),
- "/effects"
- )
+ if (config.clickableChatMessage) {
+ LorenzUtils.hoverableChat(message, listOf("§eClick to view your potion effects."), "/effects")
} else {
LorenzUtils.chat(message)
-
}
}
}