feat: 适配新版API

This commit is contained in:
2022-11-03 13:40:57 +08:00
parent acf3ae0ea0
commit 35668dcdca
4 changed files with 5 additions and 4 deletions

View File

@@ -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 {

View File

@@ -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'

View File

@@ -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();

View File

@@ -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'