diff --git a/src/main/java/net/simplycrafted/StickyLocks/Database.java b/src/main/java/net/simplycrafted/StickyLocks/Database.java index 9b4e73a..41eb0f1 100644 --- a/src/main/java/net/simplycrafted/StickyLocks/Database.java +++ b/src/main/java/net/simplycrafted/StickyLocks/Database.java @@ -299,6 +299,11 @@ public void addPlayer(Player player) { psql.setString(2, player.getName()); psql.setString(3, player.getUniqueId().toString()); psql.executeUpdate(); + // Update the name, in case the previous sub-select returned 1 + psql = db_conn.prepareStatement("UPDATE player SET name=? WHERE uuid=?"); + psql.setString(1, player.getName()); + psql.setString(2, player.getUniqueId().toString()); + psql.executeUpdate(); psql.close(); } catch (SQLException e) { stickylocks.getLogger().info("Failed to insert/replace newly joined player");