diff options
author | hannibal2 <24389977+hannibal002@users.noreply.github.com> | 2024-04-19 11:24:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-19 11:24:36 +0200 |
commit | f8efe9effd27bee18bced64385fc1ad9b05b68bd (patch) | |
tree | 1429920226fc79af8bae814bb7596b9e65e0cf7e /src/main/java/at/hannibal2/skyhanni/data/hypixel | |
parent | 7feb5c67fbc1c9f63118952f1bea649ada1dccd6 (diff) | |
download | skyhanni-f8efe9effd27bee18bced64385fc1ad9b05b68bd.tar.gz skyhanni-f8efe9effd27bee18bced64385fc1ad9b05b68bd.tar.bz2 skyhanni-f8efe9effd27bee18bced64385fc1ad9b05b68bd.zip |
Feature + Fix: Player Chat Rework (#1483)
Co-authored-by: CalMWolfs <94038482+CalMWolfs@users.noreply.github.com>
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/data/hypixel')
10 files changed, 512 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/data/hypixel/chat/PlayerChatManager.kt b/src/main/java/at/hannibal2/skyhanni/data/hypixel/chat/PlayerChatManager.kt new file mode 100644 index 000000000..2b3efb6aa --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/data/hypixel/chat/PlayerChatManager.kt @@ -0,0 +1,220 @@ +package at.hannibal2.skyhanni.data.hypixel.chat + +import at.hannibal2.skyhanni.data.IslandType +import at.hannibal2.skyhanni.data.hypixel.chat.event.AbstractChatEvent +import at.hannibal2.skyhanni.data.hypixel.chat.event.GuildChatEvent +import at.hannibal2.skyhanni.data.hypixel.chat.event.NpcChatEvent +import at.hannibal2.skyhanni.data.hypixel.chat.event.PartyChatEvent +import at.hannibal2.skyhanni.data.hypixel.chat.event.PlayerAllChatEvent +import at.hannibal2.skyhanni.data.hypixel.chat.event.PlayerShowItemChatEvent +import at.hannibal2.skyhanni.data.hypixel.chat.event.PrivateMessageChatEvent +import at.hannibal2.skyhanni.data.hypixel.chat.event.SystemMessageEvent +import at.hannibal2.skyhanni.events.LorenzChatEvent +import at.hannibal2.skyhanni.utils.LorenzUtils +import at.hannibal2.skyhanni.utils.LorenzUtils.groupOrNull +import at.hannibal2.skyhanni.utils.LorenzUtils.isInIsland +import at.hannibal2.skyhanni.utils.NumberUtil.formatInt +import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher +import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern +import net.minecraft.util.IChatComponent +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent +import java.util.regex.Matcher + +/** + * Reading normal chat events, and splitting them up into many different player chat events, with all avaliable extra information + */ +class PlayerChatManager { + + private val patternGroup = RepoPattern.group("data.chat.player") + + /** + * REGEX-TEST: §8[§r§6428§r§8] §r§b[MVP§5+§b] Alea1337§f: t + * REGEX-TEST: §8[§r§e102§r§8] §r§7☠ §r§b[MVP§d+§b] cobyjoey§f§r§f: first person to type "halo0011 is my favorite player on the game I love halo0011!!!" + * REGEX-TEST: §8[§r§5396§r§8] §r§7☢ §r§b[MVP§c+§b] hannibal2§f: hello + * REGEX-TEST: §8[§r§e97§r§8] §r§7☃ §r§7Tambaloo§7§r§7: i did capital i + * REGEX-TEST: §8[§r§f76§r§8] §r§7❂ §r§a[VIP] Asymmetrically§f§r§f: i need to put on my necron + * REGEX-TEST: §8[§r§c446§r§8] §r§b§l⚛ §r§6[MVP§1++§6] XueRuu§f§r§f: TROPHY FISH! You caught a Lavahorse DIAMOND. + * REGEX-TEST: §b[MVP§c+§b] hannibal2§f: test + */ + private val globalPattern by patternGroup.pattern( + "global", + "(?:§8\\[§r(?<levelColor>§.)(?<level>\\d+)§r§8] §r)?(?<author>§.+)(?<chatColor>§f|§7§r§7): (?<message>.*)" + ) + + /** + * REGEX-TEST: §9Party §8> §b§l⚛ §b[MVP§f+§b] Dankbarkeit§f: §rx: -190, y: 5, z: -163 + * REGEX-TEST: §9Party §8> §6⚔ §6[MVP§3++§6] RealBacklight§f: §r!warp + * REGEX-TEST: §9Party §8> §b[MVP§3+§b] Eisengolem§f: §r!pt + */ + private val partyPattern by patternGroup.pattern( + "party", + "§9Party §8> (?<author>[^:]*): §r(?<message>.*)" + ) + + /** + * REGEX-TEST: §2Guild > §b§l⚛ §b[MVP§f+§b] Dankbarkeit§f: §rx: -190, y: 5, z: -163 + * REGEX-TEST: §2Guild > §6⚔ §6[MVP§3++§6] RealBacklight§f: §r!warp + * REGEX-TEST: §2Guild > §b[MVP§3+§b] Eisengolem§f: §r!pt + * REGEX-TEST: §2Guild > §b[MVP§d+§b] zunoff §e[VET]§f: §rwas löuft + */ + private val guildPattern by patternGroup.pattern( + "guild", + "§2Guild > (?<author>§.+?)(?<guildRank> §e\\[\\w*])?§f: §r(?<message>.*)" + ) + + /** + * REGEX-TEST: §dFrom §r§b[MVP§r§3+§r§b] Eisengolem§r§7: §r§7Baum + * REGEX-TEST: §dTo §r§b[MVP§r§3+§r§b] Eisengolem§r§7: §r§7hey + * REGEX-TEST: §dTo §r§b[MVP§r§5+§r§b] Alea1337§r§7: §r§d§lBoop! + */ + private val privateMessagePattern by patternGroup.pattern( + "privatemessage", + "§d(?<direction>From|To) §r(?<author>[^:]*)§7: §r(?<message>.*)" + ) + + /** + * REGEX-TEST: §b[MVP§c+§b] hannibal2§f§7 is holding §r§8[§6Heroic Aspect of the Void§8] + * REGEX-TEST: §b[MVP§c+§b] hannibal2§f§7 is holding §r§8[§7[Lvl 2] §dSpider§8] + * REGEX-TEST: §b[MVP§c+§b] hannibal2§f§7 is friends with a §r§8[§7[Lvl 200] §8[§6103§8§4✦§8] §6Golden Dragon§8] + * REGEX-TEST: §b[MVP§c+§b] hannibal2§f§7 is wearing §r§8[§5Glistening Implosion Belt§8] + * REGEX-TEST: §b[MVP§c+§b] hannibal2§f§7 is friends with a §r§8[§7[Lvl 100] §dEnderman§8] + * REGEX-TEST: §b[MVP§c+§b] hannibal2§f§7 has §r§8[§6Heroic Aspect of the Void§8] + * REGEX-TEST: §8[§5396§8] §7☢ §r§b[MVP§c+§b] hannibal2§f§7 is holding §r§8[§6Buzzing InfiniVacuum™ Hooverius§8] + */ + private val itemShowPattern by patternGroup.pattern( + "itemshow", + "(?:§8\\[(?<levelColor>§.)(?<level>\\d+)§8] )?(?<author>.*)§f§7 (?<action>is (?:holding|friends with a|wearing)|has) §r(?<itemName>.*)" + ) + + /** + * REGEX-TEST: §c[Tiffany] §b[MVP§c+§b] hannibal2 + * REGEX-TEST: §b[MVP§c+§b] hannibal2 + * REGEX-TEST: §6§l℻ §r§f[Gamer] §b[MVP§f+§b] SchrankLP§f§r + */ + private val privateIslandRankPattern by patternGroup.pattern( + "privateislandrank", + ".*(?<privateIslandRank>§.\\[\\w+]).*" + ) + + /** + * REGEX-TEST: §8[§r§5396§r§8] §r§7☢ §r§a[✌] §b[MVP§c+§b] hannibal2§f: hey + * REGEX-TEST: §b[MVP§c+§b] hannibal2 + * REGEX-TEST: §6§l℻ §r§f[Gamer] §b[MVP§f+§b] SchrankLP§f§r + * REGEX-TEST: §7☢ §r§a[✌] §b[MVP§c+§b] hannibal2 + */ + private val prrivateIslandGuestPattern by patternGroup.pattern( + "privateislandguest", + ".*(?<guest>§r§a\\[✌]).*" + ) + + @SubscribeEvent + fun onChat(event: LorenzChatEvent) { + val chatComponent = event.chatComponent + globalPattern.matchMatcher(event.message) { + if (isGlobalChat(event)) return + } + partyPattern.matchMatcher(event.message) { + val author = group("author") + val message = group("message") + PartyChatEvent(author, message, chatComponent).postChat(event) + return + } + guildPattern.matchMatcher(event.message) { + val author = group("author") + val message = group("message") + val guildRank = groupOrNull("guildRank") + GuildChatEvent(author, message, guildRank, chatComponent).postChat(event) + return + } + privateMessagePattern.matchMatcher(event.message) { + val direction = group("direction") + val author = group("author") + val message = group("message") + PrivateMessageChatEvent(direction, author, message, chatComponent).postChat(event) + return + } + itemShowPattern.matchMatcher(event.message) { + val levelColor = groupOrNull("levelColor") + val level = groupOrNull("level")?.formatInt() + val author = group("author") + val action = group("action") + val itemName = group("itemName") + + // for consistency + val message = "§7$action §r$itemName" + PlayerShowItemChatEvent(levelColor, level, author, message, action, itemName, chatComponent).postChat(event) + } + + sendSystemMessage(event) + } + + private fun Matcher.isGlobalChat(event: LorenzChatEvent): Boolean { + var author = group("author") + // TODO move into regex + val isGuild = author.startsWith("§2Guild >") + val isParty = author.startsWith("§9Party") + if (isGuild || isParty) return false + + val message = LorenzUtils.stripVanillaMessage(group("message")) + if (author.contains("[NPC]")) { + NpcChatEvent(author, message.removePrefix("§f"), event.chatComponent).postChat(event) + return true + } + + var privateIslandRank: String? = null + var isAGuest = false + if (IslandType.PRIVATE_ISLAND.isInIsland() || IslandType.PRIVATE_ISLAND_GUEST.isInIsland()) { + privateIslandRankPattern.matchMatcher(author) { + val rank = group("privateIslandRank") + privateIslandRank = rank + author = author.replace(rank, "") + } + prrivateIslandGuestPattern.matchMatcher(author) { + val guest = group("guest") + isAGuest = true + author = author.replace(guest, "") + } + } + + val chatColor = group("chatColor") + val levelColor = groupOrNull("levelColor") + val level = groupOrNull("level")?.formatInt() + PlayerAllChatEvent( + levelColor = levelColor, + level = level, + privateIslandRank = privateIslandRank, + isAGuest = isAGuest, + author = author, + chatColor = chatColor, + message = message, + chatComponent = event.chatComponent, + ).postChat(event) + return true + } + + private fun sendSystemMessage(event: LorenzChatEvent) { + with(SystemMessageEvent(event.message, event.chatComponent)) { + val cancelled = postAndCatch() + event.handleChat(cancelled, blockedReason, chatComponent) + } + } + + private fun AbstractChatEvent.postChat(event: LorenzChatEvent) { + val cancelled = postAndCatch() + event.handleChat(cancelled, blockedReason, chatComponent) + } + + private fun LorenzChatEvent.handleChat( + cancelled: Boolean, + blockedReason: String?, + chatComponent: IChatComponent, + ) { + if (cancelled) { + this.cancel() + } + blockedReason?.let { + this.blockedReason = it + } + this.chatComponent = chatComponent + } +} diff --git a/src/main/java/at/hannibal2/skyhanni/data/hypixel/chat/PlayerNameFormatter.kt b/src/main/java/at/hannibal2/skyhanni/data/hypixel/chat/PlayerNameFormatter.kt new file mode 100644 index 000000000..4463270b3 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/data/hypixel/chat/PlayerNameFormatter.kt @@ -0,0 +1,200 @@ +package at.hannibal2.skyhanni.data.hypixel.chat + +import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator +import at.hannibal2.skyhanni.config.features.chat.PlayerMessagesConfig +import at.hannibal2.skyhanni.data.hypixel.chat.event.GuildChatEvent +import at.hannibal2.skyhanni.data.hypixel.chat.event.PartyChatEvent +import at.hannibal2.skyhanni.data.hypixel.chat.event.PlayerAllChatEvent +import at.hannibal2.skyhanni.data.hypixel.chat.event.PlayerShowItemChatEvent +import at.hannibal2.skyhanni.data.hypixel.chat.event.PrivateMessageChatEvent +import at.hannibal2.skyhanni.features.bingo.BingoAPI +import at.hannibal2.skyhanni.features.chat.playerchat.PlayerChatFilter +import at.hannibal2.skyhanni.features.misc.MarkedPlayerManager +import at.hannibal2.skyhanni.features.misc.compacttablist.AdvancedPlayerList +import at.hannibal2.skyhanni.utils.LorenzUtils +import at.hannibal2.skyhanni.utils.StringUtils +import at.hannibal2.skyhanni.utils.StringUtils.cleanPlayerName +import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher +import at.hannibal2.skyhanni.utils.StringUtils.replaceAll +import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern +import com.google.gson.JsonArray +import com.google.gson.JsonNull +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent + +/** + * Listening to the player chat events, and applying custom chat options to them. + * E.g. part order, rank hider, etc + */ +class PlayerNameFormatter { + private val config get() = SkyHanniMod.feature.chat.playerMessage + + private val patternGroup = RepoPattern.group("data.chat.player.name") + + /** + * REGEX-TEST: §7☢ §r§b[MVP§d+§b] hannibal2 + * REGEX-TEST: §7☢ §r§b[MVP§d+§b] hannibal2 + * REGEX-TEST: §7☢ §r§bhannibal2 + * REGEX-TEST: §7☢ §rhannibal2 + * REGEX-TEST: §7☢ §b[MVP§c+§b] hannibal2 + */ + private val emblemPattern by patternGroup.pattern( + "emblem", + "(?<emblem>(?:§.){1,2}.) (?<author>.*)" + ) + + @SubscribeEvent + fun onPlayerAllChat(event: PlayerAllChatEvent) { + if (!isEnabled()) return + val levelColor = event.levelColor + val level = event.level + val message = event.message + val author = event.author + val privateIslandRank = event.privateIslandRank + val isAGuest = event.isAGuest + + val shouldFilter = config.chatFilter && PlayerChatFilter.shouldChatFilter(message) + val chatColor = if (shouldFilter) "§7" else if (config.sameChatColor) "§f" else event.chatColor + + val name = nameFormat(author, levelColor, level, privateIslandRank = privateIslandRank, isAGuest = isAGuest) + val newMessage = "$name$chatColor: $message" + + event.chatComponent = StringUtils.replaceIfNeeded(event.chatComponent, newMessage) ?: return + } + + @SubscribeEvent + fun onPartyChat(event: PartyChatEvent) { + if (!isEnabled()) return + val message = event.message + val author = event.author + val name = nameFormat(author) + val newMessage = "§9Party §8> $name§f: $message" + + event.chatComponent = StringUtils.replaceIfNeeded(event.chatComponent, newMessage) ?: return + } + + @SubscribeEvent + fun onGuildChat(event: GuildChatEvent) { + if (!isEnabled()) return + val message = event.message + val author = event.author + val guildRank = event.guildRank + val name = nameFormat(author, guildRank = guildRank) + val newMessage = "§2Guild > $name§f: $message" + + event.chatComponent = StringUtils.replaceIfNeeded(event.chatComponent, newMessage) ?: return + } + + @SubscribeEvent + fun onPrivateMessageChat(event: PrivateMessageChatEvent) { + if (!isEnabled()) return + val direction = event.direction + val message = event.message + val author = event.author + val name = nameFormat(author) + val newMessage = "§d$direction §f$name§7: §f$message" + + event.chatComponent = StringUtils.replaceIfNeeded(event.chatComponent, newMessage) ?: return + } + + @SubscribeEvent + fun onPlayerShowItemChat(event: PlayerShowItemChatEvent) { + if (!isEnabled()) return + val author = event.author + val action = event.action + val itemName = event.itemName + val levelColor = event.levelColor + val level = event.level + val name = nameFormat(author, levelColor = levelColor, level = level) + val newMessage = "$name §7$action §r$itemName" + + event.chatComponent = StringUtils.replaceIfNeeded(event.chatComponent, newMessage) ?: return + } + + private fun nameFormat( + author: String, + levelColor: String? = null, + level: Int? = null, + guildRank: String? = null, + privateIslandRank: String? = null, + isAGuest: Boolean = false, + ): String { + var cleanAuthor = cleanAuthor(author) + + var emblemFormat = "" + emblemPattern.matchMatcher(author) { + emblemFormat = group("emblem") + cleanAuthor = LorenzUtils.stripVanillaMessage(group("author")) + } + + val name = formatAuthor(cleanAuthor, levelColor) + val levelFormat = formatLevel(levelColor, level) + val guildRankFormat = guildRank ?: "" + val privateIslandRankFormat = privateIslandRank ?: "" + val privateIslandGuestFormat = if (isAGuest) "§a[✌]" else "" + + val cleanName = cleanAuthor.cleanPlayerName() + val (faction, ironman, bingo) = AdvancedPlayerList.tabPlayerData[cleanName]?.let { + val faction = it.faction.icon + val ironman = if (it.ironman) "§7♲" else "" + val bingo = it.bingoLevel?.let { level -> BingoAPI.getBingoIcon(level) } ?: "" + listOf(faction, ironman, bingo) + } ?: listOf("", "", "") + + val map = mutableMapOf<PlayerMessagesConfig.MessagePart, String>() + map[PlayerMessagesConfig.MessagePart.SKYBLOCK_LEVEL] = levelFormat + map[PlayerMessagesConfig.MessagePart.EMBLEM] = emblemFormat + map[PlayerMessagesConfig.MessagePart.PLAYER_NAME] = name + map[PlayerMessagesConfig.MessagePart.CRIMSON_FACTION] = faction + map[PlayerMessagesConfig.MessagePart.MODE_IRONMAN] = ironman + map[PlayerMessagesConfig.MessagePart.BINGO_LEVEL] = bingo + map[PlayerMessagesConfig.MessagePart.GUILD_RANK] = guildRankFormat + map[PlayerMessagesConfig.MessagePart.PRIVATE_ISLAND_RANK] = privateIslandRankFormat + map[PlayerMessagesConfig.MessagePart.PRIVATE_ISLAND_GUEST] = privateIslandGuestFormat + + return config.partsOrder.map { map[it] }.joinToString(" ").replaceAll(" ", " ").trim() + } + + private fun formatLevel(rawColor: String?, rawLevel: Int?): String { + val color = rawColor ?: return "" + val level = rawLevel ?: error("level is null, color is not null") + val levelData = "$color$level" + return if (config.hideLevelBrackets) levelData else "§8[${levelData}§8]" + } + + private fun cleanAuthor(author: String): String { + val text = LorenzUtils.stripVanillaMessage(author) + return text.removeSuffix("§f") + } + + private fun formatAuthor(author: String, levelColor: String?): String { + if (author.contains("ADMIN")) return author + if (config.ignoreYouTube && author.contains("YOUTUBE")) return author + + var result = author.cleanPlayerName(displayName = true) + levelColor?.let { + if (config.useLevelColorForName) { + val cleanPlayerName = author.cleanPlayerName() + result = result.replace(cleanPlayerName, it + cleanPlayerName) + } + } + + return MarkedPlayerManager.replaceInChat(result) + } + + fun isEnabled() = LorenzUtils.inSkyBlock && (config.playerRankHider || config.chatFilter || config.sameChatColor) + + @SubscribeEvent + fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { + event.transform(41, "chat.PlayerMessagesConfig.partsOrder") { element -> + val newList = JsonArray() + for (entry in element.asJsonArray) { + if (entry is JsonNull) continue + if (entry.asString != "EMPTY_CHAR") { + newList.add(entry) + } + } + newList + } + } +} diff --git a/src/main/java/at/hannibal2/skyhanni/data/hypixel/chat/event/AbstractChatEvent.kt b/src/main/java/at/hannibal2/skyhanni/data/hypixel/chat/event/AbstractChatEvent.kt new file mode 100644 index 000000000..cd0a8f92b --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/data/hypixel/chat/event/AbstractChatEvent.kt @@ -0,0 +1,11 @@ +package at.hannibal2.skyhanni.data.hypixel.chat.event + +import at.hannibal2.skyhanni.events.LorenzEvent +import net.minecraft.util.IChatComponent + +open class AbstractChatEvent( + val author: String, + val message: String, + var chatComponent: IChatComponent, + var blockedReason: String? = null, +) : LorenzEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/data/hypixel/chat/event/GuildChatEvent.kt b/src/main/java/at/hannibal2/skyhanni/data/hypixel/chat/event/GuildChatEvent.kt new file mode 100644 index 000000000..dd3867106 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/data/hypixel/chat/event/GuildChatEvent.kt @@ -0,0 +1,11 @@ +package at.hannibal2.skyhanni.data.hypixel.chat.event + +import net.minecraft.util.IChatComponent + +class GuildChatEvent( + author: String, + message: String, + val guildRank: String? = null, + chatComponent: IChatComponent, + blockedReason: String? = null, +) : AbstractChatEvent(author, message, chatComponent, blockedReason) diff --git a/src/main/java/at/hannibal2/skyhanni/data/hypixel/chat/event/NpcChatEvent.kt b/src/main/java/at/hannibal2/skyhanni/data/hypixel/chat/event/NpcChatEvent.kt new file mode 100644 index 000000000..574324520 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/data/hypixel/chat/event/NpcChatEvent.kt @@ -0,0 +1,10 @@ +package at.hannibal2.skyhanni.data.hypixel.chat.event + +import net.minecraft.util.IChatComponent + +class NpcChatEvent( + author: String, + message: String, + chatComponent: IChatComponent, + blockedReason: String? = null, +) : AbstractChatEvent(author, message, chatComponent, blockedReason) diff --git a/src/main/java/at/hannibal2/skyhanni/data/hypixel/chat/event/PartyChatEvent.kt b/src/main/java/at/hannibal2/skyhanni/data/hypixel/chat/event/PartyChatEvent.kt new file mode 100644 index 000000000..dc9e921cc --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/data/hypixel/chat/event/PartyChatEvent.kt @@ -0,0 +1,10 @@ +package at.hannibal2.skyhanni.data.hypixel.chat.event + +import net.minecraft.util.IChatComponent + +class PartyChatEvent( + author: String, + message: String, + chatComponent: IChatComponent, + blockedReason: String? = null, +) : AbstractChatEvent(author, message, chatComponent, blockedReason) diff --git a/src/main/java/at/hannibal2/skyhanni/data/hypixel/chat/event/PlayerAllChatEvent.kt b/src/main/java/at/hannibal2/skyhanni/data/hypixel/chat/event/PlayerAllChatEvent.kt new file mode 100644 index 000000000..56ea15a64 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/data/hypixel/chat/event/PlayerAllChatEvent.kt @@ -0,0 +1,15 @@ +package at.hannibal2.skyhanni.data.hypixel.chat.event + +import net.minecraft.util.IChatComponent + +class PlayerAllChatEvent( + val levelColor: String?, + val level: Int?, + val privateIslandRank: String? = null, + val isAGuest: Boolean, + author: String, + val chatColor: String?, + message: String, + chatComponent: IChatComponent, + blockedReason: String? = null, +) : AbstractChatEvent(author, message, chatComponent, blockedReason) diff --git a/src/main/java/at/hannibal2/skyhanni/data/hypixel/chat/event/PlayerShowItemChatEvent.kt b/src/main/java/at/hannibal2/skyhanni/data/hypixel/chat/event/PlayerShowItemChatEvent.kt new file mode 100644 index 000000000..229264b27 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/data/hypixel/chat/event/PlayerShowItemChatEvent.kt @@ -0,0 +1,14 @@ +package at.hannibal2.skyhanni.data.hypixel.chat.event + +import net.minecraft.util.IChatComponent + +class PlayerShowItemChatEvent( + val levelColor: String?, + val level: Int?, + author: String, + message: String, + val action: String, + val itemName: String, + chatComponent: IChatComponent, + blockedReason: String? = null, +) : AbstractChatEvent(author, message, chatComponent, blockedReason) diff --git a/src/main/java/at/hannibal2/skyhanni/data/hypixel/chat/event/PrivateMessageChatEvent.kt b/src/main/java/at/hannibal2/skyhanni/data/hypixel/chat/event/PrivateMessageChatEvent.kt new file mode 100644 index 000000000..f23b1d0b0 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/data/hypixel/chat/event/PrivateMessageChatEvent.kt @@ -0,0 +1,11 @@ +package at.hannibal2.skyhanni.data.hypixel.chat.event + +import net.minecraft.util.IChatComponent + +class PrivateMessageChatEvent( + val direction: String?, + author: String, + message: String, + chatComponent: IChatComponent, + blockedReason: String? = null, +) : AbstractChatEvent(author, message, chatComponent, blockedReason) diff --git a/src/main/java/at/hannibal2/skyhanni/data/hypixel/chat/event/SystemMessageEvent.kt b/src/main/java/at/hannibal2/skyhanni/data/hypixel/chat/event/SystemMessageEvent.kt new file mode 100644 index 000000000..82c53d0b1 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/data/hypixel/chat/event/SystemMessageEvent.kt @@ -0,0 +1,10 @@ +package at.hannibal2.skyhanni.data.hypixel.chat.event + +import at.hannibal2.skyhanni.events.LorenzEvent +import net.minecraft.util.IChatComponent + +class SystemMessageEvent( + val message: String, + var chatComponent: IChatComponent, + var blockedReason: String? = null, +) : LorenzEvent() |