mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-12-29 03:57:54 +01:00
Only set custom class when valid class
This commit is contained in:
parent
36b09421e8
commit
f5eb7a10de
@ -40,10 +40,10 @@ public class DatabaseManagerFactory {
|
|||||||
public static void setCustomDatabaseManagerClass(Class<? extends DatabaseManager> clazz) {
|
public static void setCustomDatabaseManagerClass(Class<? extends DatabaseManager> clazz) {
|
||||||
try {
|
try {
|
||||||
clazz.getConstructor((Class<?>) null);
|
clazz.getConstructor((Class<?>) null);
|
||||||
|
customManager = clazz;
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
throw new IllegalArgumentException("Provided database manager class must have an empty constructor", e);
|
throw new IllegalArgumentException("Provided database manager class must have an empty constructor", e);
|
||||||
}
|
}
|
||||||
customManager = clazz;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Class<? extends DatabaseManager> getCustomDatabaseManagerClass() {
|
public static Class<? extends DatabaseManager> getCustomDatabaseManagerClass() {
|
||||||
|
Loading…
Reference in New Issue
Block a user