Fix kits frfrfrfr?

Signed-off-by: Chaoscaot <max@maxsp.de>
This commit is contained in:
2025-12-20 22:10:25 +01:00
parent 1269e4d971
commit d348e4a480
2 changed files with 3 additions and 2 deletions
@@ -72,9 +72,8 @@ class InternalKit(id: EntityID<CompositeID>): CompositeEntity(id) {
) {
this.inventory = rawInventory
this.armor = rawArmor
this.inUse = true
}
}
}.also { it.setDefault() }
@JvmStatic
fun getKitInUse(userId: Int, gamemode: String) = useDb {
@@ -23,6 +23,7 @@ import org.intellij.lang.annotations.Language
import org.jetbrains.exposed.v1.core.ColumnType
import org.jetbrains.exposed.v1.core.Expression
import org.jetbrains.exposed.v1.core.ResultRow
import org.jetbrains.exposed.v1.core.StdOutSqlLogger
import org.jetbrains.exposed.v1.core.statements.StatementType
import org.jetbrains.exposed.v1.dao.IntEntity
import org.jetbrains.exposed.v1.dao.IntEntityClass
@@ -69,6 +70,7 @@ object KotlinDatabase {
fun <T: Any?> useDb(statement: JdbcTransaction.() -> T): T {
KotlinDatabase.ensureConnected()
return TransactionManager.currentOrNull()?.statement() ?: transaction(KotlinDatabase.db) {
addLogger(StdOutSqlLogger)
statement()
}
}