Skip to content

Commit 60e26d2

Browse files
authored
Migrated to new UUID to name conversion API (#395)
* fix uuid -> name from API * correct uri path
1 parent edd8f35 commit 60e26d2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/kotlin/com/lambda/client/capeapi/AbstractUUIDManager.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ abstract class AbstractUUIDManager(
8080
try {
8181
val jsonElement = parser.parse(response)
8282
if (isUUID) {
83-
val name = jsonElement.asJsonArray.last().asJsonObject["name"].asString
83+
val name = jsonElement.asJsonObject["name"].asString
8484
PlayerProfile(UUID.fromString(nameOrUUID), name)
8585
} else {
8686
val id = jsonElement.asJsonObject["id"].asString
@@ -95,7 +95,7 @@ abstract class AbstractUUIDManager(
9595
}
9696

9797
private fun requestProfileFromUUID(uuid: String): String? {
98-
return request("https://api.mojang.com/user/profiles/${UUIDUtils.removeDashes(uuid)}/names")
98+
return request("https://sessionserver.mojang.com/session/minecraft/profile/${UUIDUtils.removeDashes(uuid)}")
9999
}
100100

101101
private fun requestProfileFromName(name: String): String? {

0 commit comments

Comments
 (0)