aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/com/dulkirfabric/Registrations.kt
diff options
context:
space:
mode:
authoringlettronald <inglettronald@gmail.com>2023-07-23 21:47:02 -0500
committeringlettronald <inglettronald@gmail.com>2023-07-23 21:47:02 -0500
commitc56059b6c9d28d17d82de090c5a0b9d9382cb82c (patch)
treeaa1f6b2c4798502c6f2ccafff788eb04f17c8379 /src/main/kotlin/com/dulkirfabric/Registrations.kt
parentc36dd88ff83ff09d5941d6772b5eefff0cd10665 (diff)
downloadDulkirMod-Fabric-c56059b6c9d28d17d82de090c5a0b9d9382cb82c.tar.gz
DulkirMod-Fabric-c56059b6c9d28d17d82de090c5a0b9d9382cb82c.tar.bz2
DulkirMod-Fabric-c56059b6c9d28d17d82de090c5a0b9d9382cb82c.zip
Chat stacking with lots of refactor
Diffstat (limited to 'src/main/kotlin/com/dulkirfabric/Registrations.kt')
-rw-r--r--src/main/kotlin/com/dulkirfabric/Registrations.kt8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/main/kotlin/com/dulkirfabric/Registrations.kt b/src/main/kotlin/com/dulkirfabric/Registrations.kt
index fdace3c..7e68f90 100644
--- a/src/main/kotlin/com/dulkirfabric/Registrations.kt
+++ b/src/main/kotlin/com/dulkirfabric/Registrations.kt
@@ -3,12 +3,13 @@ package com.dulkirfabric
import com.dulkirfabric.DulkirModFabric.EVENT_BUS
import com.dulkirfabric.commands.*
import com.dulkirfabric.events.*
-import com.dulkirfabric.events.chat.ChatReceivedEvent
+import com.dulkirfabric.events.chat.ChatEvents
import com.dulkirfabric.events.chat.ModifyCommandEvent
import com.dulkirfabric.events.chat.OverlayReceivedEvent
import com.dulkirfabric.features.*
import com.dulkirfabric.features.chat.AbiPhoneDND
import com.dulkirfabric.features.chat.BridgeBotFormatter
+import com.dulkirfabric.features.chat.ChatStacking
import com.dulkirfabric.hud.ActionBarHudReplacements
import com.dulkirfabric.hud.SpeedOverlay
import com.dulkirfabric.util.ActionBarUtil
@@ -75,6 +76,7 @@ object Registrations {
EVENT_BUS.subscribe(SpeedOverlay)
EVENT_BUS.subscribe(ActionBarUtil)
EVENT_BUS.subscribe(ActionBarHudReplacements)
+ EVENT_BUS.subscribe(ChatStacking)
}
fun registerEvents() {
@@ -86,13 +88,13 @@ object Registrations {
}
ClientReceiveMessageEvents.ALLOW_GAME.register { message, overlay ->
if (!overlay)
- return@register !ChatReceivedEvent(message).post()
+ return@register !ChatEvents.AllowChat(message).post()
return@register true
}
ClientReceiveMessageEvents.MODIFY_GAME.register { message, overlay ->
if (overlay)
return@register OverlayReceivedEvent(message).post()
- return@register message
+ return@register ChatEvents.ModifyChat(message).post()
}
ClientSendMessageEvents.MODIFY_COMMAND.register { command ->