This commit is contained in:
@@ -80,4 +80,27 @@ public class ConfigManager {
|
||||
public boolean isPlaceholderApiEnabled() {
|
||||
return config.getBoolean("integrations.placeholderapi", true);
|
||||
}
|
||||
|
||||
public StorageSettings getStorageSettings() {
|
||||
String type = config.getString("storage.type", "sqlite");
|
||||
return new StorageSettings(
|
||||
type,
|
||||
config.getString("storage.mysql.host", "localhost"),
|
||||
config.getInt("storage.mysql.port", 3306),
|
||||
config.getString("storage.mysql.database", "blockparty"),
|
||||
config.getString("storage.mysql.username", "blockparty"),
|
||||
config.getString("storage.mysql.password", ""),
|
||||
config.getBoolean("storage.mysql.use-ssl", false),
|
||||
config.getString("storage.mysql.table-prefix", "bp_")
|
||||
);
|
||||
}
|
||||
|
||||
/** Immutable snapshot of the storage.* config section. */
|
||||
public record StorageSettings(String type, String host, int port, String database,
|
||||
String username, String password, boolean useSsl, String tablePrefix) {
|
||||
|
||||
public boolean isMysql() {
|
||||
return "mysql".equalsIgnoreCase(type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user