update 1.2.1

This commit is contained in:
mlus-Asuka 2023-09-29 16:50:26 +08:00
parent 5de0fdcff6
commit d32ae52537
5 changed files with 12 additions and 7 deletions

View File

@ -4,7 +4,7 @@ plugins {
id 'net.minecraftforge.gradle' version '5.1.+'
}
version = '1.2.0'
version = mod_version
group = 'vip.fubuki.playersync' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = 'playersync'

View File

@ -1,4 +1,6 @@
# Sets default memory used for gradle commands. Can be overridden by user or command line properties.
# This is required to provide enough memory for the Minecraft decompilation process.
org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false
org.gradle.daemon=false
mod_version=1.20.1-1.2.1

View File

@ -41,7 +41,7 @@ public class PlayerSync
@SubscribeEvent
public void onServerStarting(ServerStartingEvent event) throws SQLException {
JDBCsetUp.executeUpdate("CREATE DATABASE IF NOT EXISTS "+JdbcConfig.DATABASE_NAME.get());
JDBCsetUp.executeUpdate("CREATE DATABASE IF NOT EXISTS "+JdbcConfig.DATABASE_NAME.get(),1);
JDBCsetUp.executeUpdate("CREATE TABLE IF NOT EXISTS player_data (uuid CHAR(36) NOT NULL," +
"inventory MEDIUMBLOB,armor BLOB,advancements BLOB,enderchest MEDIUMBLOB,effects BLOB," +

View File

@ -24,13 +24,16 @@ public class JDBCsetUp {
}
public static int executeUpdate(String sql) throws SQLException{
return executeUpdate(sql,0);
}
public static int executeUpdate(String sql,int init) throws SQLException{
try (Connection connection = getConnection()) {
try (PreparedStatement useStatement = connection.prepareStatement("USE " + JdbcConfig.DATABASE_NAME.get())) {
useStatement.executeUpdate();
if(init==0){
sql="USE " + JdbcConfig.DATABASE_NAME.get() +";" + sql;
}
try (PreparedStatement updateStatement = connection.prepareStatement(sql)) {
return updateStatement.executeUpdate();
}

View File

@ -19,7 +19,7 @@ modId="playersync" #mandatory
# The version number of the mod - there's a few well known ${} variables useable here or just hardcode it
# ${file.jarVersion} will substitute the value of the Implementation-Version as read from the mod's JAR file metadata
# see the associated build.gradle script for how to populate this completely automatically during a build
version="1.2.0" #mandatory
version="${file.jarVersion}" #mandatory
# A display name for the mod
displayName="PlayerSync" #mandatory
# A URL to query for updates for this mod. See the JSON update specification https://mcforge.readthedocs.io/en/latest/gettingstarted/autoupdate/