mirror of
https://github.com/jie65535/mirai-console-jms-plugin.git
synced 2025-06-02 17:39:17 +08:00
fix: UUID API
This commit is contained in:
parent
adef471210
commit
c45298c035
@ -7,7 +7,7 @@ plugins {
|
|||||||
}
|
}
|
||||||
|
|
||||||
group = "top.jie65535.mirai"
|
group = "top.jie65535.mirai"
|
||||||
version = "1.1.0"
|
version = "1.1.1"
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
maven("https://maven.aliyun.com/repository/public")
|
maven("https://maven.aliyun.com/repository/public")
|
||||||
|
@ -9,7 +9,7 @@ object JMinecraftSkin : KotlinPlugin(
|
|||||||
JvmPluginDescription(
|
JvmPluginDescription(
|
||||||
id = "top.jie65535.mirai-console-jms-plugin",
|
id = "top.jie65535.mirai-console-jms-plugin",
|
||||||
name = "J Minecraft Skin",
|
name = "J Minecraft Skin",
|
||||||
version = "1.1.0",
|
version = "1.1.1",
|
||||||
) {
|
) {
|
||||||
author("jie65535")
|
author("jie65535")
|
||||||
info("MC皮肤查询插件")
|
info("MC皮肤查询插件")
|
||||||
|
@ -1,10 +1,7 @@
|
|||||||
package top.jie65535
|
package top.jie65535
|
||||||
|
|
||||||
import kotlinx.serialization.decodeFromString
|
import kotlinx.serialization.decodeFromString
|
||||||
import kotlinx.serialization.json.Json
|
import kotlinx.serialization.json.*
|
||||||
import kotlinx.serialization.json.JsonNull
|
|
||||||
import kotlinx.serialization.json.JsonObject
|
|
||||||
import kotlinx.serialization.json.jsonPrimitive
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Minecraft UUID Service
|
* Minecraft UUID Service
|
||||||
@ -25,7 +22,7 @@ object MinecraftUuidService {
|
|||||||
val retJson = HttpUtil.get("https://tenapi.cn/v2/mc/?uid=$username").decodeToString()
|
val retJson = HttpUtil.get("https://tenapi.cn/v2/mc/?uid=$username").decodeToString()
|
||||||
val response = Json.decodeFromString<JsonObject>(retJson)
|
val response = Json.decodeFromString<JsonObject>(retJson)
|
||||||
if (response["code"]!!.jsonPrimitive.content == "200") {
|
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!")
|
if (elem == JsonNull) throw Exception("Player UUID Not Found!")
|
||||||
uuid = elem.content
|
uuid = elem.content
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user