Skip to content

Commit

Permalink
fix: UUID API
Browse files Browse the repository at this point in the history
  • Loading branch information
SBBTD authored and jie65535 committed Feb 22, 2024
1 parent adef471 commit 0fcc1c0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ plugins {
}

group = "top.jie65535.mirai"
version = "1.1.0"
version = "1.1.1"

repositories {
maven("https://maven.aliyun.com/repository/public")
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/JMinecraftSkin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ object JMinecraftSkin : KotlinPlugin(
JvmPluginDescription(
id = "top.jie65535.mirai-console-jms-plugin",
name = "J Minecraft Skin",
version = "1.1.0",
version = "1.1.1",
) {
author("jie65535")
info("MC皮肤查询插件")
Expand Down
7 changes: 2 additions & 5 deletions src/main/kotlin/MinecraftUuidService.kt
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
package top.jie65535

import kotlinx.serialization.decodeFromString
import kotlinx.serialization.json.Json
import kotlinx.serialization.json.JsonNull
import kotlinx.serialization.json.JsonObject
import kotlinx.serialization.json.jsonPrimitive
import kotlinx.serialization.json.*

/**
* Minecraft UUID Service
Expand All @@ -25,7 +22,7 @@ object MinecraftUuidService {
val retJson = HttpUtil.get("https://tenapi.cn/v2/mc/?uid=$username").decodeToString()
val response = Json.decodeFromString<JsonObject>(retJson)
if (response["code"]!!.jsonPrimitive.content == "200") {
val elem = response["id"]!!.jsonPrimitive
val elem = response["data"]!!.jsonObject["id"]!!.jsonPrimitive
if (elem == JsonNull) throw Exception("Player UUID Not Found!")
uuid = elem.content
} else {
Expand Down

0 comments on commit 0fcc1c0

Please sign in to comment.