mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-30 00:56:47 +01:00
Oh! So that's why it's never used here
This commit is contained in:
parent
b3cf9bf839
commit
7a95b7a8d9
@ -10,7 +10,7 @@ public class DatabaseManagerFactory {
|
|||||||
public static DatabaseManager getDatabaseManager() {
|
public static DatabaseManager getDatabaseManager() {
|
||||||
if (customManager != null) {
|
if (customManager != null) {
|
||||||
try {
|
try {
|
||||||
return createCustomDatabaseManager(customManager);
|
return createDefaultCustomDatabaseManager();
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
mcMMO.p.debug("Could not create custom database manager");
|
mcMMO.p.debug("Could not create custom database manager");
|
||||||
@ -63,13 +63,24 @@ public class DatabaseManagerFactory {
|
|||||||
case SQL:
|
case SQL:
|
||||||
return new SQLDatabaseManager();
|
return new SQLDatabaseManager();
|
||||||
|
|
||||||
|
case CUSTOM:
|
||||||
|
try {
|
||||||
|
return createDefaultCustomDatabaseManager();
|
||||||
|
} catch (Throwable e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO: Why is clazz never used here?
|
public static DatabaseManager createDefaultCustomDatabaseManager() throws Throwable {
|
||||||
|
return customManager.getConstructor((Class<?>) null).newInstance((Object[]) null);
|
||||||
|
}
|
||||||
|
|
||||||
public static DatabaseManager createCustomDatabaseManager(Class<? extends DatabaseManager> clazz) throws Throwable {
|
public static DatabaseManager createCustomDatabaseManager(Class<? extends DatabaseManager> clazz) throws Throwable {
|
||||||
return customManager.getConstructor((Class<?>) clazz).newInstance((Object[]) null);
|
return clazz.getConstructor((Class<?>) null).newInstance((Object[]) null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user