back port to jdk 8

This commit is contained in:
mlus-Asuka 2023-09-28 19:22:47 +08:00
parent e3f4aa888c
commit a60cd29ece
3 changed files with 3 additions and 8 deletions

View File

@ -8,7 +8,7 @@ version = '1.2.0'
group = 'vip.fubuki.playersync' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = 'playersync'
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
java.toolchain.languageVersion = JavaLanguageVersion.of(8)
println "Java: ${System.getProperty 'java.version'}, JVM: ${System.getProperty 'java.vm.version'} (${System.getProperty 'java.vendor'}), Arch: ${System.getProperty 'os.arch'}"
minecraft {

View File

@ -45,12 +45,7 @@ public class PlayerSync
"xp int,food_level int,score int,health int,online boolean, last_server int, PRIMARY KEY (uuid))");
JDBCsetUp.executeUpdate("CREATE TABLE IF NOT EXISTS chat (player CHAR(36) NOT NULL,message TEXT," +
"timestamp BIGINT)");
JDBCsetUp.executeUpdate("""
CREATE TABLE IF NOT EXISTS server_info (
`id` INT NOT NULL,
`enable` boolean NOT NULL,
`last_update` BIGINT NOT NULL,
PRIMARY KEY (`id`));""");
JDBCsetUp.executeUpdate(" CREATE TABLE IF NOT EXISTS server_info (`id` INT NOT NULL,`enable` boolean NOT NULL,`last_update` BIGINT NOT NULL,PRIMARY KEY (`id`));");
long current = System.currentTimeMillis();
JDBCsetUp.executeUpdate("INSERT INTO server_info(id,enable,last_update) " +
"VALUES(" + JdbcConfig.SERVER_ID.get() + ",true," + current + ") " +

View File

@ -31,7 +31,7 @@ public class JdbcConfig {
USE_SSL = COMMON_BUILDER.comment("whether use SSL").define("use_ssl", false);
USERNAME = COMMON_BUILDER.comment("username").define("user_name", "root");
PASSWORD = COMMON_BUILDER.comment("password").define("password", "password");
SERVER_ID = COMMON_BUILDER.comment("the server id should be unique").define("Server_id", new Random().nextInt(1,Integer.MAX_VALUE-1));
SERVER_ID = COMMON_BUILDER.comment("the server id should be unique").define("Server_id", (int) (Math.random()*Integer.MAX_VALUE));
SYNC_WORLD = COMMON_BUILDER.comment("The worlds that will be synchronized.If running in server it is supposed to have only one").define("sync_world", new ArrayList<>());
SYNC_CHAT= COMMON_BUILDER.comment("Whether synchronize chat").define("sync_chat", true);
COMMON_BUILDER.pop();