From 35668dcdcadd8d973a4eed46eeb99e3ce8325ac3 Mon Sep 17 00:00:00 2001 From: MiniDay <372403923@qq.com> Date: Thu, 3 Nov 2022 13:40:57 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=80=82=E9=85=8D=E6=96=B0=E7=89=88API?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hamster-ball-bukkit/build.gradle | 2 +- hamster-ball-common/build.gradle | 2 +- .../java/cn/hamster3/mc/plugin/ball/common/api/BallAPI.java | 3 ++- hamster-ball-server/build.gradle | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/hamster-ball-bukkit/build.gradle b/hamster-ball-bukkit/build.gradle index af46e2c..dde6561 100644 --- a/hamster-ball-bukkit/build.gradle +++ b/hamster-ball-bukkit/build.gradle @@ -8,7 +8,7 @@ dependencies { compileOnly 'org.spigotmc:spigot-api:1.12.2-R0.1-SNAPSHOT' compileOnly "cn.hamster3.mc.plugin.core:bukkit:${hamster_core_version}" - apiShade("me.clip:placeholderapi:2.11.2") { transitive = false } + compileOnly("me.clip:placeholderapi:2.11.2") { transitive = false } } processResources { diff --git a/hamster-ball-common/build.gradle b/hamster-ball-common/build.gradle index b443905..78be76f 100644 --- a/hamster-ball-common/build.gradle +++ b/hamster-ball-common/build.gradle @@ -3,7 +3,7 @@ setArchivesBaseName("HamsterBall-Common") dependencies { // https://mvnrepository.com/artifact/com.google.code.gson/gson //noinspection GradlePackageUpdate - compileOnly 'com.google.code.gson:gson:2.8.0' + compileOnly 'com.google.code.gson:gson:2.8.9' // https://mvnrepository.com/artifact/io.netty/netty-all compileOnly 'io.netty:netty-all:4.1.82.Final' diff --git a/hamster-ball-common/src/main/java/cn/hamster3/mc/plugin/ball/common/api/BallAPI.java b/hamster-ball-common/src/main/java/cn/hamster3/mc/plugin/ball/common/api/BallAPI.java index cd12e96..ec89487 100644 --- a/hamster-ball-common/src/main/java/cn/hamster3/mc/plugin/ball/common/api/BallAPI.java +++ b/hamster-ball-common/src/main/java/cn/hamster3/mc/plugin/ball/common/api/BallAPI.java @@ -19,6 +19,7 @@ import cn.hamster3.mc.plugin.core.common.constant.CoreConstantObjects; import cn.hamster3.mc.plugin.core.common.data.DisplayMessage; import com.google.gson.JsonElement; import com.google.gson.JsonObject; +import com.google.gson.JsonParser; import com.google.gson.JsonPrimitive; import io.netty.bootstrap.Bootstrap; import io.netty.channel.Channel; @@ -638,7 +639,7 @@ public abstract class BallAPI { statement.setString(1, uuid.toString()); ResultSet set = statement.executeQuery(); while (set.next()) { - JsonObject object = CoreConstantObjects.JSON_PARSER.parse(set.getString("msg")).getAsJsonObject(); + JsonObject object = JsonParser.parseString(set.getString("msg")).getAsJsonObject(); list.add(new DisplayMessage().fromJson(object)); } statement.close(); diff --git a/hamster-ball-server/build.gradle b/hamster-ball-server/build.gradle index cf237ab..4689357 100644 --- a/hamster-ball-server/build.gradle +++ b/hamster-ball-server/build.gradle @@ -18,7 +18,7 @@ dependencies { // https://mvnrepository.com/artifact/org.yaml/snakeyaml implementationShade 'org.yaml:snakeyaml:1.33' // https://mvnrepository.com/artifact/com.google.code.gson/gson - implementationShade 'com.google.code.gson:gson:2.10' + implementationShade 'com.google.code.gson:gson:2.8.9' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.0'