mirror of
https://github.com/Zrips/Jobs.git
synced 2025-01-06 16:27:59 +01:00
Fixed when changed the database throws error
- Now support PlaceholderAPI the latest version - Now support MythicMobs the latest version
This commit is contained in:
parent
e2a306acb4
commit
d3442c8fe2
4
pom.xml
4
pom.xml
@ -64,7 +64,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.lumine.xikage.mythicmobs</groupId>
|
<groupId>io.lumine.xikage.mythicmobs</groupId>
|
||||||
<artifactId>MythicMobs</artifactId>
|
<artifactId>MythicMobs</artifactId>
|
||||||
<version>4.5.0</version>
|
<version>4.5.1</version>
|
||||||
<scope>system</scope>
|
<scope>system</scope>
|
||||||
<systemPath>${basedir}/libs/MythicMobs-4.5.0.jar</systemPath>
|
<systemPath>${basedir}/libs/MythicMobs-4.5.0.jar</systemPath>
|
||||||
</dependency>
|
</dependency>
|
||||||
@ -108,7 +108,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>me.clip</groupId>
|
<groupId>me.clip</groupId>
|
||||||
<artifactId>placeholderapi</artifactId>
|
<artifactId>placeholderapi</artifactId>
|
||||||
<version>2.0.6</version>
|
<version>2.9.2</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
@ -29,19 +29,19 @@ public class JobsManager {
|
|||||||
if (dao != null)
|
if (dao != null)
|
||||||
dao.closeConnections();
|
dao.closeConnections();
|
||||||
switch (DbType) {
|
switch (DbType) {
|
||||||
case MySQL:
|
case SqLite:
|
||||||
DbType = DataBaseType.SqLite;
|
DbType = DataBaseType.SqLite;
|
||||||
dao = startSqlite();
|
dao = startSqlite();
|
||||||
dao.setDbType(DbType);
|
dao.setDbType(DbType);
|
||||||
break;
|
break;
|
||||||
case SqLite:
|
case MySQL:
|
||||||
DbType = DataBaseType.MySQL;
|
DbType = DataBaseType.MySQL;
|
||||||
dao = startMysql();
|
dao = startMysql();
|
||||||
dao.setDbType(DbType);
|
dao.setDbType(DbType);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
File f = new File(plugin.getDataFolder(), "generalConfig.yml");
|
File f = new File(Jobs.getFolder(), "generalConfig.yml");
|
||||||
YamlConfiguration config = YamlConfiguration.loadConfiguration(f);
|
YamlConfiguration config = YamlConfiguration.loadConfiguration(f);
|
||||||
|
|
||||||
config.set("storage.method", DbType.toString());
|
config.set("storage.method", DbType.toString());
|
||||||
@ -74,7 +74,7 @@ public class JobsManager {
|
|||||||
DbType = DataBaseType.SqLite;
|
DbType = DataBaseType.SqLite;
|
||||||
dao = startSqlite();
|
dao = startSqlite();
|
||||||
} else {
|
} else {
|
||||||
Jobs.consoleMsg("&cInvalid storage method! Changing method to sqlite!");
|
Jobs.consoleMsg("&cInvalid storage method! Changing method to sqlite!");
|
||||||
c.getC().set("storage.method", "sqlite");
|
c.getC().set("storage.method", "sqlite");
|
||||||
DbType = DataBaseType.SqLite;
|
DbType = DataBaseType.SqLite;
|
||||||
dao = startSqlite();
|
dao = startSqlite();
|
||||||
@ -83,7 +83,7 @@ public class JobsManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private synchronized JobsMySQL startMysql() {
|
private synchronized JobsMySQL startMysql() {
|
||||||
File f = new File(plugin.getDataFolder(), "generalConfig.yml");
|
File f = new File(Jobs.getFolder(), "generalConfig.yml");
|
||||||
YamlConfiguration config = YamlConfiguration.loadConfiguration(f);
|
YamlConfiguration config = YamlConfiguration.loadConfiguration(f);
|
||||||
String legacyUrl = config.getString("mysql-url");
|
String legacyUrl = config.getString("mysql-url");
|
||||||
if (legacyUrl != null) {
|
if (legacyUrl != null) {
|
||||||
@ -118,7 +118,7 @@ public class JobsManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private synchronized JobsSQLite startSqlite() {
|
private synchronized JobsSQLite startSqlite() {
|
||||||
JobsSQLite data = new JobsSQLite(plugin, plugin.getDataFolder());
|
JobsSQLite data = new JobsSQLite(plugin, Jobs.getFolder());
|
||||||
data.initialize();
|
data.initialize();
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user