From 9565ab0641e50a1bc348c85f369a9e01ce0991e9 Mon Sep 17 00:00:00 2001 From: Auxilor Date: Fri, 2 Apr 2021 12:26:56 +0100 Subject: [PATCH] Fixed StaticOptionalConfig --- .../eco/util/config/StaticOptionalConfig.java | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/eco-util/src/main/java/com/willfp/eco/util/config/StaticOptionalConfig.java b/eco-util/src/main/java/com/willfp/eco/util/config/StaticOptionalConfig.java index 536108218..4df45f4f2 100644 --- a/eco-util/src/main/java/com/willfp/eco/util/config/StaticOptionalConfig.java +++ b/eco-util/src/main/java/com/willfp/eco/util/config/StaticOptionalConfig.java @@ -5,7 +5,7 @@ import org.bukkit.configuration.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; -public abstract class StaticOptionalConfig extends AbstractUndefinedConfig { +public abstract class StaticOptionalConfig extends AbstractUndefinedConfig { /** * Config implementation for passing YamlConfigurations. *

@@ -14,11 +14,26 @@ public abstract class StaticOptionalConfig extends AbstractUndefinedConfig { * @param configName The name of the config * @param plugin The plugin. * @param config The YamlConfiguration handle. + * @deprecated Plugin not required. */ + @Deprecated public StaticOptionalConfig(@NotNull final String configName, @NotNull final AbstractEcoPlugin plugin, @NotNull final YamlConfiguration config) { - super(configName, plugin); + this(configName, config); + } + + /** + * Config implementation for passing YamlConfigurations. + *

+ * Does not automatically update. + * + * @param configName The name of the config + * @param config The YamlConfiguration handle. + */ + public StaticOptionalConfig(@NotNull final String configName, + @NotNull final YamlConfiguration config) { + super(configName); init(config); }