Add MVCoreConfigProvider#getConfigUnsafe.

This commit is contained in:
Jeremy Wood 2023-03-07 16:58:29 -05:00
parent a57a83a047
commit 015c58421d
No known key found for this signature in database
GPG Key ID: C5BAD04C77B91B4B

View File

@ -14,6 +14,7 @@ import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.PluginManager;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jvnet.hk2.annotations.Service;
import java.io.BufferedReader;
@ -49,6 +50,17 @@ public final class MVCoreConfigProvider {
return Option.of(config);
}
/**
* Provided to make porting code to use DI easier for now.
*
* @deprecated Use the {@link #getConfig()} method instead when possible.
*/
@Nullable
@Deprecated
public MVConfig getConfigUnsafe() {
return config;
}
public void loadConfigs() {
multiverseConfig = loadConfigWithDefaults();
setConfigOptions(multiverseConfig);