From 015c58421da5a8569eab7563befd474fb0d0c983 Mon Sep 17 00:00:00 2001 From: Jeremy Wood Date: Tue, 7 Mar 2023 16:58:29 -0500 Subject: [PATCH] Add MVCoreConfigProvider#getConfigUnsafe. --- .../MultiverseCore/config/MVCoreConfigProvider.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/main/java/com/onarandombox/MultiverseCore/config/MVCoreConfigProvider.java b/src/main/java/com/onarandombox/MultiverseCore/config/MVCoreConfigProvider.java index 221278b0..0577b05a 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/config/MVCoreConfigProvider.java +++ b/src/main/java/com/onarandombox/MultiverseCore/config/MVCoreConfigProvider.java @@ -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);