diff options
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"); |