Removed Bukkit stuff I missed from the general use API

This commit is contained in:
2021-08-01 03:20:49 +02:00
parent e253894a77
commit dfcf8de34e
6 changed files with 49 additions and 20 deletions
@@ -434,4 +434,30 @@ public class Queries {
e.printStackTrace();
}
}
public static String getDisplayName(UUID uuid) {
String nickname = getNickname(uuid);
if (nickname != null) return nickname;
// View has been created.
String query = "SELECT Username FROM utility_users WHERE uuid = ?";
try {
Connection connection = DatabaseConnection.getConnection();
PreparedStatement statement = connection.prepareStatement(query);
statement.setString(1, uuid.toString());
ResultSet resultSet = statement.executeQuery();
if (resultSet.next()) {
return resultSet.getString("Username");
}
} catch (SQLException e) {
e.printStackTrace();
}
return null;
}
}