diff options
author | isXander <xandersmith2008@gmail.com> | 2023-04-15 22:21:45 +0100 |
---|---|---|
committer | isXander <xandersmith2008@gmail.com> | 2023-04-15 22:21:45 +0100 |
commit | 74bcc11c74f864eda2f5e48a3c038846c20065ba (patch) | |
tree | 4cd72c84135c103ba55fc91742504c0d513ed3b3 /src/client/java/dev/isxander/yacl/impl | |
parent | 257a50da0880dac23a81933e39b27e381616bd61 (diff) | |
download | YetAnotherConfigLib-74bcc11c74f864eda2f5e48a3c038846c20065ba.tar.gz YetAnotherConfigLib-74bcc11c74f864eda2f5e48a3c038846c20065ba.tar.bz2 YetAnotherConfigLib-74bcc11c74f864eda2f5e48a3c038846c20065ba.zip |
2.4.1
Diffstat (limited to 'src/client/java/dev/isxander/yacl/impl')
-rw-r--r-- | src/client/java/dev/isxander/yacl/impl/ConfigCategoryImpl.java | 2 | ||||
-rw-r--r-- | src/client/java/dev/isxander/yacl/impl/OptionImpl.java | 9 |
2 files changed, 10 insertions, 1 deletions
diff --git a/src/client/java/dev/isxander/yacl/impl/ConfigCategoryImpl.java b/src/client/java/dev/isxander/yacl/impl/ConfigCategoryImpl.java index efbd8c9..b3d28b3 100644 --- a/src/client/java/dev/isxander/yacl/impl/ConfigCategoryImpl.java +++ b/src/client/java/dev/isxander/yacl/impl/ConfigCategoryImpl.java @@ -74,7 +74,7 @@ public final class ConfigCategoryImpl implements ConfigCategory { } @Override - public Builder options(@NotNull Collection<Option<?>> options) { + public Builder options(@NotNull Collection<? extends Option<?>> options) { Validate.notNull(options, "`options` must not be null"); if (options.stream().anyMatch(ListOption.class::isInstance)) diff --git a/src/client/java/dev/isxander/yacl/impl/OptionImpl.java b/src/client/java/dev/isxander/yacl/impl/OptionImpl.java index d333e36..35ad620 100644 --- a/src/client/java/dev/isxander/yacl/impl/OptionImpl.java +++ b/src/client/java/dev/isxander/yacl/impl/OptionImpl.java @@ -176,7 +176,16 @@ public final class OptionImpl<T> implements Option<T> { } @Override + public Builder<T> tooltip(@NotNull Function<T, Component> tooltipGetter) { + Validate.notNull(tooltipGetter, "`tooltipGetter` cannot be null"); + + this.tooltipGetters.add(tooltipGetter); + return this; + } + + @Override @SafeVarargs + @Deprecated public final Option.Builder<T> tooltip(@NotNull Function<T, Component>... tooltipGetter) { Validate.notNull(tooltipGetter, "`tooltipGetter` cannot be null"); |