diff --git a/eco-api/src/main/java/com/willfp/eco/core/config/TransientConfig.java b/eco-api/src/main/java/com/willfp/eco/core/config/TransientConfig.java index b038b783..fb9cbc74 100644 --- a/eco-api/src/main/java/com/willfp/eco/core/config/TransientConfig.java +++ b/eco-api/src/main/java/com/willfp/eco/core/config/TransientConfig.java @@ -39,11 +39,11 @@ public class TransientConfig extends ConfigWrapper { /** * @param file The File. + * @deprecated Specify the config type to prevent bugs. */ + @Deprecated(since = "6.30.0", forRemoval = true) public TransientConfig(@Nullable final File file) { - super(file != null ? Eco.getHandler().getConfigFactory().createConfig(YamlConfiguration.loadConfiguration( - file - )) : new TransientConfig()); + this(file, ConfigType.YAML); } /** diff --git a/eco-api/src/main/java/com/willfp/eco/core/config/interfaces/Config.java b/eco-api/src/main/java/com/willfp/eco/core/config/interfaces/Config.java index 37eb70ed..44ecd3e2 100644 --- a/eco-api/src/main/java/com/willfp/eco/core/config/interfaces/Config.java +++ b/eco-api/src/main/java/com/willfp/eco/core/config/interfaces/Config.java @@ -247,35 +247,6 @@ public interface Config extends Cloneable, PlaceholderInjectable { return getString(path, false, StringUtils.FormatOption.WITHOUT_PLACEHOLDERS); } - /** - * Get a string from config. - * - * @param path The key to fetch the value from. - * @param format If the string should be formatted. - * @return The found value, or an empty string if not found. - * @deprecated Since 6.18.0, {@link Config#getString(String)} is not formatted by default. - */ - @Deprecated(since = "6.18.0") - default String getString(@NotNull String path, - boolean format) { - return this.getString(path, format, StringUtils.FormatOption.WITH_PLACEHOLDERS); - } - - /** - * Get a string from config. - * - * @param path The key to fetch the value from. - * @param option The format option. - * @return The found value, or an empty string if not found. - * @deprecated Use {@link Config#getFormattedString(String, StringUtils.FormatOption)} instead. - */ - @NotNull - @Deprecated - default String getString(@NotNull String path, - @NotNull final StringUtils.FormatOption option) { - return this.getString(path, true, option); - } - /** * Get a string from config. * @@ -328,36 +299,6 @@ public interface Config extends Cloneable, PlaceholderInjectable { return getStringOrNull(path, false, StringUtils.FormatOption.WITH_PLACEHOLDERS); } - /** - * Get a string from config. - * - * @param path The key to fetch the value from. - * @param format If the string should be formatted. - * @return The found value, or null if not found. - * @deprecated Since 6.18.0, {@link Config#getString(String)} is not formatted by default. - */ - @Nullable - @Deprecated(since = "6.18.0") - default String getStringOrNull(@NotNull String path, - boolean format) { - return this.getStringOrNull(path, format, StringUtils.FormatOption.WITH_PLACEHOLDERS); - } - - /** - * Get a string from config. - * - * @param path The key to fetch the value from. - * @param option The format option. - * @return The found value, or null if not found. - * @deprecated Use {@link Config#getFormattedString(String, StringUtils.FormatOption)} instead. - */ - @Nullable - @Deprecated - default String getStringOrNull(@NotNull String path, - @NotNull StringUtils.FormatOption option) { - return this.getStringOrNull(path, true, option); - } - /** * Get a string from config. * @@ -412,36 +353,6 @@ public interface Config extends Cloneable, PlaceholderInjectable { return getStrings(path, false, StringUtils.FormatOption.WITH_PLACEHOLDERS); } - /** - * Get a list of strings from config. - * - * @param path The key to fetch the value from. - * @param format If the strings should be formatted. - * @return The found value, or a blank {@link java.util.ArrayList} if not found. - * @deprecated Since 6.18.0, {@link Config#getString(String)} is not formatted by default. - */ - @NotNull - @Deprecated(since = "6.18.0") - default List getStrings(@NotNull String path, - boolean format) { - return this.getStrings(path, format, StringUtils.FormatOption.WITH_PLACEHOLDERS); - } - - /** - * Get a list of strings from config. - * - * @param path The key to fetch the value from. - * @param option The format option. - * @return The found value, or a blank {@link java.util.ArrayList} if not found. - * @deprecated Use {@link Config#getFormattedStrings(String, StringUtils.FormatOption)} instead. - */ - @NotNull - @Deprecated - default List getStrings(@NotNull String path, - @NotNull StringUtils.FormatOption option) { - return getStrings(path, false, option); - } - /** * Get a list of strings from config. * @@ -500,36 +411,6 @@ public interface Config extends Cloneable, PlaceholderInjectable { return getStringsOrNull(path, false, StringUtils.FormatOption.WITH_PLACEHOLDERS); } - /** - * Get a list of strings from config. - * - * @param path The key to fetch the value from. - * @param format If the strings should be formatted. - * @return The found value, or null if not found. - * @deprecated Since 6.18.0, {@link Config#getString(String)} is not formatted by default. - */ - @Nullable - @Deprecated(since = "6.18.0") - default List getStringsOrNull(@NotNull String path, - boolean format) { - return getStringsOrNull(path, format, StringUtils.FormatOption.WITH_PLACEHOLDERS); - } - - /** - * Get a list of strings from config. - * - * @param path The key to fetch the value from. - * @param option The format option. - * @return The found value, or null if not found. - * @deprecated Use {@link Config#getFormattedStringsOrNull(String, StringUtils.FormatOption)} instead. - */ - @Nullable - @Deprecated - default List getStringsOrNull(@NotNull String path, - @NotNull StringUtils.FormatOption option) { - return getStringsOrNull(path, false, option); - } - /** * Get a list of strings from config. *