diff options
author | Jacob <admin@kath.lol> | 2025-05-04 18:20:06 +0800 |
---|---|---|
committer | Linnea Gräf <nea@nea.moe> | 2025-05-04 16:07:45 +0200 |
commit | 9e42f111e976f0863691b78f72b59cf1771225a3 (patch) | |
tree | 2508546353b19605770b2a7b2b57d88b223dae73 /src | |
parent | a70aa604a3452af9b70e62696b980d761d09aa53 (diff) | |
download | Firmament-9e42f111e976f0863691b78f72b59cf1771225a3.tar.gz Firmament-9e42f111e976f0863691b78f72b59cf1771225a3.tar.bz2 Firmament-9e42f111e976f0863691b78f72b59cf1771225a3.zip |
replace: ashcon with mowojang api
Diffstat (limited to 'src')
-rw-r--r-- | src/main/kotlin/apis/Profiles.kt | 4 | ||||
-rw-r--r-- | src/main/kotlin/apis/Routes.kt | 14 |
2 files changed, 9 insertions, 9 deletions
diff --git a/src/main/kotlin/apis/Profiles.kt b/src/main/kotlin/apis/Profiles.kt index 789364a..6b3c50d 100644 --- a/src/main/kotlin/apis/Profiles.kt +++ b/src/main/kotlin/apis/Profiles.kt @@ -188,7 +188,7 @@ data class PlayerData( } @Serializable -data class AshconNameLookup( +data class MowojangNameLookup( val username: String, - val uuid: UUID, + val id: UUID, ) diff --git a/src/main/kotlin/apis/Routes.kt b/src/main/kotlin/apis/Routes.kt index bf55a2d..2864c9b 100644 --- a/src/main/kotlin/apis/Routes.kt +++ b/src/main/kotlin/apis/Routes.kt @@ -28,11 +28,11 @@ object Routes { return withContext(MinecraftDispatcher) { UUIDToName.computeIfAbsent(uuid) { async(Firmament.coroutineScope.coroutineContext) { - val response = Firmament.httpClient.get("https://api.ashcon.app/mojang/v2/user/$uuid") + val response = Firmament.httpClient.get("https://mowojang.matdoes.dev/$uuid") if (!response.status.isSuccess()) return@async null - val data = response.body<AshconNameLookup>() + val data = response.body<MowojangNameLookup>() launch(MinecraftDispatcher) { - nameToUUID[data.username] = async { data.uuid } + nameToUUID[data.username] = async { data.id } } data.username } @@ -44,13 +44,13 @@ object Routes { return withContext(MinecraftDispatcher) { nameToUUID.computeIfAbsent(name) { async(Firmament.coroutineScope.coroutineContext) { - val response = Firmament.httpClient.get("https://api.ashcon.app/mojang/v2/user/$name") + val response = Firmament.httpClient.get("https://mowojang.matdoes.dev/$name") if (!response.status.isSuccess()) return@async null - val data = response.body<AshconNameLookup>() + val data = response.body<MowojangNameLookup>() launch(MinecraftDispatcher) { - UUIDToName[data.uuid] = async { data.username } + UUIDToName[data.id] = async { data.username } } - data.uuid + data.id } } }.await() |