mirror of
https://github.com/Zrips/Jobs.git
synced 2025-01-04 23:37:49 +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>
|
||||
<groupId>io.lumine.xikage.mythicmobs</groupId>
|
||||
<artifactId>MythicMobs</artifactId>
|
||||
<version>4.5.0</version>
|
||||
<version>4.5.1</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${basedir}/libs/MythicMobs-4.5.0.jar</systemPath>
|
||||
</dependency>
|
||||
@ -108,7 +108,7 @@
|
||||
<dependency>
|
||||
<groupId>me.clip</groupId>
|
||||
<artifactId>placeholderapi</artifactId>
|
||||
<version>2.0.6</version>
|
||||
<version>2.9.2</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
@ -29,19 +29,19 @@ public class JobsManager {
|
||||
if (dao != null)
|
||||
dao.closeConnections();
|
||||
switch (DbType) {
|
||||
case MySQL:
|
||||
case SqLite:
|
||||
DbType = DataBaseType.SqLite;
|
||||
dao = startSqlite();
|
||||
dao.setDbType(DbType);
|
||||
break;
|
||||
case SqLite:
|
||||
case MySQL:
|
||||
DbType = DataBaseType.MySQL;
|
||||
dao = startMysql();
|
||||
dao.setDbType(DbType);
|
||||
break;
|
||||
}
|
||||
|
||||
File f = new File(plugin.getDataFolder(), "generalConfig.yml");
|
||||
File f = new File(Jobs.getFolder(), "generalConfig.yml");
|
||||
YamlConfiguration config = YamlConfiguration.loadConfiguration(f);
|
||||
|
||||
config.set("storage.method", DbType.toString());
|
||||
@ -74,7 +74,7 @@ public class JobsManager {
|
||||
DbType = DataBaseType.SqLite;
|
||||
dao = startSqlite();
|
||||
} 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");
|
||||
DbType = DataBaseType.SqLite;
|
||||
dao = startSqlite();
|
||||
@ -83,7 +83,7 @@ public class JobsManager {
|
||||
}
|
||||
|
||||
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);
|
||||
String legacyUrl = config.getString("mysql-url");
|
||||
if (legacyUrl != null) {
|
||||
@ -118,7 +118,7 @@ public class JobsManager {
|
||||
}
|
||||
|
||||
private synchronized JobsSQLite startSqlite() {
|
||||
JobsSQLite data = new JobsSQLite(plugin, plugin.getDataFolder());
|
||||
JobsSQLite data = new JobsSQLite(plugin, Jobs.getFolder());
|
||||
data.initialize();
|
||||
return data;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user