use of com.djrapitops.plan.delivery.domain.datatransfer.extension.ExtensionsDto in project Plan by plan-player-analytics.
the class PlayerJSONCreator method playerExtensionData.
public List<ExtensionsDto> playerExtensionData(UUID playerUUID) {
Database database = dbSystem.getDatabase();
Map<ServerUUID, List<ExtensionData>> extensionPlayerData = database.query(new ExtensionPlayerDataQuery(playerUUID));
Map<ServerUUID, Server> servers = database.query(ServerQueries.fetchPlanServerInformation());
List<ExtensionsDto> playerData = new ArrayList<>();
for (Map.Entry<ServerUUID, Server> entry : servers.entrySet()) {
ServerUUID serverUUID = entry.getKey();
playerData.add(new ExtensionsDto(playerUUID.toString(), serverUUID.toString(), entry.getValue().getIdentifiableName(), extensionPlayerData.getOrDefault(serverUUID, Collections.emptyList())));
}
return playerData;
}
Aggregations