aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/moe/nea/ledger/Ledger.kt
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2024-02-15 21:59:56 +0100
committerLinnea Gräf <nea@nea.moe>2024-02-15 21:59:56 +0100
commit277643f8c39ad02d9485f7fc9039243f098ec383 (patch)
treeb14325e5188a0998510f15ece249c377c9090368 /src/main/kotlin/moe/nea/ledger/Ledger.kt
parentebe98ada20e5de258f5c4eee6bfa7f8ae79489b9 (diff)
downloadmoney-ledger-277643f8c39ad02d9485f7fc9039243f098ec383.tar.gz
money-ledger-277643f8c39ad02d9485f7fc9039243f098ec383.tar.bz2
money-ledger-277643f8c39ad02d9485f7fc9039243f098ec383.zip
use higher priority and add logging
Diffstat (limited to 'src/main/kotlin/moe/nea/ledger/Ledger.kt')
-rw-r--r--src/main/kotlin/moe/nea/ledger/Ledger.kt8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main/kotlin/moe/nea/ledger/Ledger.kt b/src/main/kotlin/moe/nea/ledger/Ledger.kt
index e9f5efc..108c238 100644
--- a/src/main/kotlin/moe/nea/ledger/Ledger.kt
+++ b/src/main/kotlin/moe/nea/ledger/Ledger.kt
@@ -4,7 +4,9 @@ import net.minecraftforge.client.event.ClientChatReceivedEvent
import net.minecraftforge.common.MinecraftForge
import net.minecraftforge.fml.common.Mod
import net.minecraftforge.fml.common.event.FMLInitializationEvent
+import net.minecraftforge.fml.common.eventhandler.EventPriority
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
+import org.apache.logging.log4j.LogManager
@Mod(modid = "ledger", useMetadata = true)
class Ledger {
@@ -33,9 +35,13 @@ class Ledger {
TODO: TRADING, FORGE, COOKIE_EATEN, NPC_SELL, NPC_BUY
*/
+ companion object {
+ val logger = LogManager.getLogger("MoneyLedger")
+ }
@Mod.EventHandler
fun init(event: FMLInitializationEvent) {
+ logger.info("Initializing ledger")
val ledger = LedgerLogger()
val ids = ItemIdProvider()
listOf(
@@ -48,7 +54,7 @@ class Ledger {
).forEach(MinecraftForge.EVENT_BUS::register)
}
- @SubscribeEvent
+ @SubscribeEvent(receiveCanceled = true, priority = EventPriority.HIGHEST)
fun onChat(event: ClientChatReceivedEvent) {
if (event.type != 2.toByte())
MinecraftForge.EVENT_BUS.post(ChatReceived(event))