update 1.2.1
This commit is contained in:
parent
76836f680f
commit
2931022721
|
|
@ -4,7 +4,7 @@ plugins {
|
||||||
id 'net.minecraftforge.gradle' version '5.1.+'
|
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
|
group = 'vip.fubuki.playersync' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
|
||||||
archivesBaseName = 'playersync'
|
archivesBaseName = 'playersync'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,3 +2,5 @@
|
||||||
# This is required to provide enough memory for the Minecraft decompilation process.
|
# This is required to provide enough memory for the Minecraft decompilation process.
|
||||||
org.gradle.jvmargs=-Xmx3G
|
org.gradle.jvmargs=-Xmx3G
|
||||||
org.gradle.daemon=false
|
org.gradle.daemon=false
|
||||||
|
|
||||||
|
mod_version=1.18.2-1.2.1
|
||||||
|
|
@ -41,7 +41,7 @@ public class PlayerSync
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onServerStarting(ServerStartingEvent event) throws SQLException {
|
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," +
|
JDBCsetUp.executeUpdate("CREATE TABLE IF NOT EXISTS player_data (uuid CHAR(36) NOT NULL," +
|
||||||
"inventory MEDIUMBLOB,armor BLOB,advancements BLOB,enderchest MEDIUMBLOB,effects BLOB," +
|
"inventory MEDIUMBLOB,armor BLOB,advancements BLOB,enderchest MEDIUMBLOB,effects BLOB," +
|
||||||
|
|
|
||||||
|
|
@ -24,13 +24,16 @@ public class JDBCsetUp {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int executeUpdate(String sql) throws SQLException{
|
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 (Connection connection = getConnection()) {
|
||||||
|
|
||||||
try (PreparedStatement useStatement = connection.prepareStatement("USE " + JdbcConfig.DATABASE_NAME.get())) {
|
if(init==0){
|
||||||
useStatement.executeUpdate();
|
sql="USE " + JdbcConfig.DATABASE_NAME.get() +";" + sql;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
try (PreparedStatement updateStatement = connection.prepareStatement(sql)) {
|
try (PreparedStatement updateStatement = connection.prepareStatement(sql)) {
|
||||||
return updateStatement.executeUpdate();
|
return updateStatement.executeUpdate();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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
|
# 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
|
# ${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
|
# 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
|
# A display name for the mod
|
||||||
displayName="PlayerSync" #mandatory
|
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/
|
# A URL to query for updates for this mod. See the JSON update specification https://mcforge.readthedocs.io/en/latest/gettingstarted/autoupdate/
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user