aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/moe/nea/ledger/LedgerLogger.kt
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2025-01-07 15:57:48 +0100
committerLinnea Gräf <nea@nea.moe>2025-01-07 15:57:48 +0100
commitdc19995f2b11ba595775b7224df200e365e7c4bf (patch)
tree0baee487f75db329c73e9125b030f0b6d5dd741b /src/main/kotlin/moe/nea/ledger/LedgerLogger.kt
parent0ee8a4fdfedf20d543f42ab52a2f24af089271ac (diff)
downloadLocalTransactionLedger-dc19995f2b11ba595775b7224df200e365e7c4bf.tar.gz
LocalTransactionLedger-dc19995f2b11ba595775b7224df200e365e7c4bf.tar.bz2
LocalTransactionLedger-dc19995f2b11ba595775b7224df200e365e7c4bf.zip
refactor: Extract database to its own module
Diffstat (limited to 'src/main/kotlin/moe/nea/ledger/LedgerLogger.kt')
-rw-r--r--src/main/kotlin/moe/nea/ledger/LedgerLogger.kt7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main/kotlin/moe/nea/ledger/LedgerLogger.kt b/src/main/kotlin/moe/nea/ledger/LedgerLogger.kt
index 913d1b5..6049aa2 100644
--- a/src/main/kotlin/moe/nea/ledger/LedgerLogger.kt
+++ b/src/main/kotlin/moe/nea/ledger/LedgerLogger.kt
@@ -6,6 +6,7 @@ import moe.nea.ledger.database.DBItemEntry
import moe.nea.ledger.database.DBLogEntry
import moe.nea.ledger.database.Database
import moe.nea.ledger.events.ChatReceived
+import moe.nea.ledger.utils.ULIDWrapper
import moe.nea.ledger.utils.di.Inject
import net.minecraft.client.Minecraft
import net.minecraft.util.ChatComponentText
@@ -86,10 +87,10 @@ class LedgerLogger {
if (shouldLog)
printToChat(entry)
Ledger.logger.info("Logging entry of type ${entry.transactionType}")
- val transactionId = UUIDUtil.createULIDAt(entry.timestamp)
+ val transactionId = ULIDWrapper.createULIDAt(entry.timestamp)
DBLogEntry.insert(database.connection) {
- it[DBLogEntry.profileId] = currentProfile ?: UUIDUtil.NIL_UUID
- it[DBLogEntry.playerId] = UUIDUtil.getPlayerUUID()
+ it[DBLogEntry.profileId] = currentProfile ?: MCUUIDUtil.NIL_UUID
+ it[DBLogEntry.playerId] = MCUUIDUtil.getPlayerUUID()
it[DBLogEntry.type] = entry.transactionType
it[DBLogEntry.transactionId] = transactionId
}