Move config load earlier in startup process (#4083)

This commit is contained in:
Luck committed 2025-06-14 09:31:56 +01:00
1 parent bac0edd90e
commit 51fe574a51
1 file changed
+10 -10
@@ -132,6 +132,16 @@ public abstract class AbstractLuckPermsPlugin implements LuckPermsPlugin {
// load some utilities early
this.permissionRegistry = new AsyncPermissionRegistry(getBootstrap().getScheduler());
this.verboseHandler = new VerboseHandler(getBootstrap().getScheduler());
// load configuration
getLogger().info("Loading configuration...");
ConfigurationAdapter configFileAdapter = provideConfigurationAdapter();
this.configuration = new LuckPermsConfiguration(this, new MultiConfigurationAdapter(this,
new FileSecretConfigAdapter(this),
new SystemPropertyConfigAdapter(this),
new EnvironmentVariableConfigAdapter(this),
configFileAdapter
));
}
public final void enable() {
@@ -144,16 +154,6 @@ public abstract class AbstractLuckPermsPlugin implements LuckPermsPlugin {
// setup log dispatcher instance early
this.logDispatcher = new LogDispatcher(this);
// load configuration
getLogger().info("Loading configuration...");
ConfigurationAdapter configFileAdapter = provideConfigurationAdapter();
this.configuration = new LuckPermsConfiguration(this, new MultiConfigurationAdapter(this,
new FileSecretConfigAdapter(this),
new SystemPropertyConfigAdapter(this),
new EnvironmentVariableConfigAdapter(this),
configFileAdapter
));
// setup a bytebin instance
this.httpClient = new OkHttpClient.Builder()
.callTimeout(15, TimeUnit.SECONDS)