Config Manager
Comprehensive configuration management system for the McMMO Core plugin.
This class serves as the central hub for all configuration operations within the McMMO plugin ecosystem. It provides a type-safe, organized approach to managing plugin settings, database configuration, debugging options, and gameplay features.
Key Responsibilities:
Loading and parsing configuration from YAML files
Providing type-safe access to configuration values
Maintaining default values for all configuration options
Supporting configuration validation and error handling
Enabling runtime configuration updates and persistence
Organizing configuration into logical categories (database, debug, settings)
Configuration Categories:
Database Configuration:
MySQL connection parameters (host, port, database name)
Authentication credentials (username, password)
Connection security options (SSL enablement)
Performance tuning (connection pool sizing)
Debug Configuration:
Debug mode enablement for development and troubleshooting
Configurable logging levels for different environments
Development-specific features and verbose output
Gameplay Settings:
Welcome message system configuration
Automated save intervals for data persistence
Player experience and interaction customization
Design Patterns:
Singleton-like access through the plugin instance
Immutable public access with private setters for data integrity
Lazy loading with explicit configuration loading calls
Default value fallbacks for missing or invalid configuration entries
Thread Safety: This class is designed to be thread-safe for reading configuration values after initialization. Configuration loading and saving operations should be performed from the main server thread to avoid concurrency issues with Bukkit's configuration system.
Error Handling: The ConfigManager provides robust error handling for common configuration issues:
Missing configuration files (creates defaults)
Invalid or corrupted YAML syntax (falls back to defaults)
Missing configuration keys (uses predefined defaults)
Type mismatches in configuration values (safe casting with defaults)
Performance Considerations:
Configuration values are cached in memory after loading
No file I/O occurs during normal configuration value access
Bulk configuration operations are optimized for minimal overhead
Configuration reloading is supported without plugin restart
Since
1.0.0
Author
McMMO Core Team
Parameters
The CorePlugin instance that owns this ConfigManager
See also
for the underlying Bukkit configuration system
for the plugin instance that uses this configuration
Properties
The interval in minutes between automatic data saves.
The size of the HikariCP database connection pool.
The password for authenticating with the MySQL database server.
The username for authenticating with the MySQL database server.
Flag indicating whether debug mode is enabled for the plugin.
The logging level to use when debug mode is enabled.
Flag indicating whether the welcome message system is enabled.
The welcome message template displayed to players when they join the server.