From 416db6867fb350c57f4f7a2ebbf38791ec2982b4 Mon Sep 17 00:00:00 2001 From: TomTom <93038247+AverageGithub@users.noreply.github.com> Date: Mon, 1 Jul 2024 10:07:40 +0200 Subject: [PATCH] Fix --- .../axminions/data/H2DataHandler.kt | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/common/src/main/kotlin/com/artillexstudios/axminions/data/H2DataHandler.kt b/common/src/main/kotlin/com/artillexstudios/axminions/data/H2DataHandler.kt index ab7deed..886ab82 100644 --- a/common/src/main/kotlin/com/artillexstudios/axminions/data/H2DataHandler.kt +++ b/common/src/main/kotlin/com/artillexstudios/axminions/data/H2DataHandler.kt @@ -428,13 +428,17 @@ class H2DataHandler : DataHandler { } override fun addUser(uuid: UUID, name: String) { - dataSource.connection.use { connection -> - connection.prepareStatement("INSERT IGNORE INTO `axminions_users`(`uuid`, `name`, `island_slots`) VALUES (?,?,?);").use { statement -> - statement.setObject(1, uuid) - statement.setString(2, name) - statement.setInt(3, 0) - statement.executeUpdate() + try { + dataSource.connection.use { connection -> + connection.prepareStatement("INSERT INTO `axminions_users`(`uuid`, `name`, `island_slots`) VALUES (?,?,?);").use { statement -> + statement.setObject(1, uuid) + statement.setString(2, name) + statement.setInt(3, 0) + statement.executeUpdate() + } } + } catch (exception: Exception) { + } }