diff --git a/pom.xml b/pom.xml index 78de93a..f3fbd8d 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ com.songoda UltimateStacker 4.0.0 - 2.0.9 + 2.0.10 clean install UltimateStacker-${project.version} diff --git a/src/main/java/com/songoda/ultimatestacker/database/migrations/_2_EntityStacks.java b/src/main/java/com/songoda/ultimatestacker/database/migrations/_2_EntityStacks.java index 7d14ac4..0d9ea95 100644 --- a/src/main/java/com/songoda/ultimatestacker/database/migrations/_2_EntityStacks.java +++ b/src/main/java/com/songoda/ultimatestacker/database/migrations/_2_EntityStacks.java @@ -32,7 +32,7 @@ public class _2_EntityStacks extends DataMigration { statement.execute("CREATE TABLE " + tablePrefix + "stacked_entities (" + "uuid VARCHAR(36) PRIMARY KEY NOT NULL," + "host INTEGER NOT NULL," + - "serialized_entity VARBINARY NOT NULL" + + "serialized_entity VARBINARY(255) NOT NULL" + ")"); } } diff --git a/src/main/java/com/songoda/ultimatestacker/database/migrations/_3_BlockStacks.java b/src/main/java/com/songoda/ultimatestacker/database/migrations/_3_BlockStacks.java index 4562ca4..66e12ab 100644 --- a/src/main/java/com/songoda/ultimatestacker/database/migrations/_3_BlockStacks.java +++ b/src/main/java/com/songoda/ultimatestacker/database/migrations/_3_BlockStacks.java @@ -23,7 +23,7 @@ public class _3_BlockStacks extends DataMigration { statement.execute("CREATE TABLE " + tablePrefix + "blocks (" + "id INTEGER PRIMARY KEY" + autoIncrement + ", " + "amount INTEGER NOT NULL," + - "material STRING NOT NULL," + + "material TEXT NOT NULL," + "world TEXT NOT NULL, " + "x DOUBLE NOT NULL, " + "y DOUBLE NOT NULL, " + diff --git a/src/main/java/com/songoda/ultimatestacker/utils/MySQLDatabase.java b/src/main/java/com/songoda/ultimatestacker/utils/MySQLDatabase.java deleted file mode 100644 index d332821..0000000 --- a/src/main/java/com/songoda/ultimatestacker/utils/MySQLDatabase.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.songoda.ultimatestacker.utils; - -import com.songoda.ultimatestacker.UltimateStacker; - -import java.sql.Connection; -import java.sql.DriverManager; -import java.sql.SQLException; - -public class MySQLDatabase { - - private final UltimateStacker instance; - - private Connection connection; - - public MySQLDatabase(UltimateStacker instance) { - this.instance = instance; - try { - Class.forName("com.mysql.jdbc.Driver"); - - String url = "jdbc:mysql://" + instance.getConfig().getString("Database.IP") + ":" + instance.getConfig().getString("Database.Port") + "/" + instance.getConfig().getString("Database.Database Name") + "?autoReconnect=true&useSSL=false"; - this.connection = DriverManager.getConnection(url, instance.getConfig().getString("Database.Username"), instance.getConfig().getString("Database.Password")); - - createTables(); - - } catch (ClassNotFoundException | SQLException e) { - System.out.println("Database connection failed."); - } - } - - private void createTables() { - try { - - connection.createStatement().execute("CREATE TABLE IF NOT EXISTS `" + instance.getConfig().getString("Database.Prefix") + "spawners` (\n" + - "\t`location` TEXT NULL,\n" + - "\t`amount` INT NULL\n" + - ")"); - - } catch (SQLException e) { - e.printStackTrace(); - } - } - - public Connection getConnection() { - return connection; - } -} \ No newline at end of file