Explorar el Código

0.2.0 more apis

Unknown hace 6 años
padre
commit
6532db4b4c

+ 1 - 1
gradle.properties

@@ -2,5 +2,5 @@ minecraft_version=1.14.2
 yarn_version=1.14.2+build.2
 fabric_loader_version=0.4.7+build.147
 fabric_version=0.3.0-pre+build.165
-mod_version=0.1.0
+mod_version=0.2.0
 modmenu_version=1.5.4-85

+ 3 - 0
src/main/java/me/shedaniel/clothconfig2/api/ConfigBuilder.java

@@ -1,6 +1,7 @@
 package me.shedaniel.clothconfig2.api;
 
 import me.shedaniel.clothconfig2.impl.ConfigBuilderImpl;
+import me.shedaniel.clothconfig2.impl.ConfigEntryBuilderImpl;
 import net.minecraft.client.gui.screen.Screen;
 import net.minecraft.util.Identifier;
 
@@ -67,6 +68,8 @@ public interface ConfigBuilder {
     
     Consumer<Screen> getAfterInitConsumer();
     
+    ConfigEntryBuilderImpl getEntryBuilder();
+    
     ConfigBuilder setAfterInitConsumer(Consumer<Screen> afterInitConsumer);
     
     Screen build();

+ 6 - 0
src/main/java/me/shedaniel/clothconfig2/impl/ConfigBuilderImpl.java

@@ -28,12 +28,18 @@ public class ConfigBuilderImpl implements ConfigBuilder {
     private Consumer<Screen> afterInitConsumer = screen -> {};
     private Map<String, Identifier> categoryBackground = Maps.newHashMap();
     private Map<String, List<Pair<String, Object>>> dataMap = Maps.newLinkedHashMap();
+    private ConfigEntryBuilderImpl entryBuilder = ConfigEntryBuilderImpl.create();
     
     @Deprecated
     public ConfigBuilderImpl() {
     
     }
     
+    @Override
+    public ConfigEntryBuilderImpl getEntryBuilder() {
+        return entryBuilder;
+    }
+    
     @Override
     public ConfigBuilder setAfterInitConsumer(Consumer<Screen> afterInitConsumer) {
         this.afterInitConsumer = afterInitConsumer;

+ 17 - 3
src/main/java/me/shedaniel/clothconfig2/impl/builders/BooleanToggleBuilder.java

@@ -1,6 +1,5 @@
 package me.shedaniel.clothconfig2.impl.builders;
 
-import me.shedaniel.clothconfig2.api.AbstractConfigListEntry;
 import me.shedaniel.clothconfig2.gui.entries.BooleanListEntry;
 
 import java.util.Objects;
@@ -9,7 +8,7 @@ import java.util.function.Consumer;
 import java.util.function.Function;
 import java.util.function.Supplier;
 
-public class BooleanToggleBuilder extends FieldBuilder<Boolean> {
+public class BooleanToggleBuilder extends FieldBuilder<Boolean, BooleanListEntry> {
     
     private Consumer<Boolean> saveConsumer = null;
     private Supplier<Optional<String[]>> tooltipSupplier = null;
@@ -31,11 +30,26 @@ public class BooleanToggleBuilder extends FieldBuilder<Boolean> {
         return this;
     }
     
+    public BooleanToggleBuilder setDefaultValue(boolean defaultValue) {
+        this.defaultValue = () -> defaultValue;
+        return this;
+    }
+    
     public BooleanToggleBuilder setTooltipSupplier(Supplier<Optional<String[]>> tooltipSupplier) {
         this.tooltipSupplier = tooltipSupplier;
         return this;
     }
     
+    public BooleanToggleBuilder setTooltip(Optional<String[]> tooltip) {
+        this.tooltipSupplier = () -> tooltip;
+        return this;
+    }
+    
+    public BooleanToggleBuilder setTooltip(String... tooltip) {
+        this.tooltipSupplier = () -> Optional.ofNullable(tooltip);
+        return this;
+    }
+    
     public BooleanToggleBuilder setYesNoTextSupplier(Function<Boolean, String> yesNoTextSupplier) {
         Objects.requireNonNull(yesNoTextSupplier);
         this.yesNoTextSupplier = yesNoTextSupplier;
@@ -43,7 +57,7 @@ public class BooleanToggleBuilder extends FieldBuilder<Boolean> {
     }
     
     @Override
-    public AbstractConfigListEntry buildEntry() {
+    public BooleanListEntry build() {
         return new BooleanListEntry(getFieldNameKey(), value, getResetButtonKey(), defaultValue, saveConsumer, tooltipSupplier) {
             @Override
             public String getYesNoText(boolean bool) {

+ 17 - 3
src/main/java/me/shedaniel/clothconfig2/impl/builders/DoubleFieldBuilder.java

@@ -1,13 +1,12 @@
 package me.shedaniel.clothconfig2.impl.builders;
 
-import me.shedaniel.clothconfig2.api.AbstractConfigListEntry;
 import me.shedaniel.clothconfig2.gui.entries.DoubleListEntry;
 
 import java.util.Optional;
 import java.util.function.Consumer;
 import java.util.function.Supplier;
 
-public class DoubleFieldBuilder extends FieldBuilder<Double> {
+public class DoubleFieldBuilder extends FieldBuilder<Double, DoubleListEntry> {
     
     private Consumer<Double> saveConsumer = null;
     private Supplier<Optional<String[]>> tooltipSupplier = null;
@@ -29,6 +28,11 @@ public class DoubleFieldBuilder extends FieldBuilder<Double> {
         return this;
     }
     
+    public DoubleFieldBuilder setDefaultValue(double defaultValue) {
+        this.defaultValue = () -> defaultValue;
+        return this;
+    }
+    
     public DoubleFieldBuilder setMin(double min) {
         this.min = min;
         return this;
@@ -54,8 +58,18 @@ public class DoubleFieldBuilder extends FieldBuilder<Double> {
         return this;
     }
     
+    public DoubleFieldBuilder setTooltip(Optional<String[]> tooltip) {
+        this.tooltipSupplier = () -> tooltip;
+        return this;
+    }
+    
+    public DoubleFieldBuilder setTooltip(String... tooltip) {
+        this.tooltipSupplier = () -> Optional.ofNullable(tooltip);
+        return this;
+    }
+    
     @Override
-    public AbstractConfigListEntry buildEntry() {
+    public DoubleListEntry build() {
         DoubleListEntry entry = new DoubleListEntry(getFieldNameKey(), value, getResetButtonKey(), defaultValue, saveConsumer, tooltipSupplier);
         if (min != null)
             entry.setMinimum(min);

+ 19 - 4
src/main/java/me/shedaniel/clothconfig2/impl/builders/EnumSelectorBuilder.java

@@ -1,6 +1,5 @@
 package me.shedaniel.clothconfig2.impl.builders;
 
-import me.shedaniel.clothconfig2.api.AbstractConfigListEntry;
 import me.shedaniel.clothconfig2.gui.entries.EnumListEntry;
 
 import java.util.Objects;
@@ -9,7 +8,7 @@ import java.util.function.Consumer;
 import java.util.function.Function;
 import java.util.function.Supplier;
 
-public class EnumSelectorBuilder<T extends Enum<?>> extends FieldBuilder<T> {
+public class EnumSelectorBuilder<T extends Enum<?>> extends FieldBuilder<T, EnumListEntry<T>> {
     
     private Consumer<T> saveConsumer = null;
     private Supplier<Optional<String[]>> tooltipSupplier = null;
@@ -35,11 +34,27 @@ public class EnumSelectorBuilder<T extends Enum<?>> extends FieldBuilder<T> {
         return this;
     }
     
+    public EnumSelectorBuilder setDefaultValue(T defaultValue) {
+        Objects.requireNonNull(defaultValue);
+        this.defaultValue = () -> defaultValue;
+        return this;
+    }
+    
     public EnumSelectorBuilder setTooltipSupplier(Supplier<Optional<String[]>> tooltipSupplier) {
         this.tooltipSupplier = tooltipSupplier;
         return this;
     }
     
+    public EnumSelectorBuilder setTooltip(Optional<String[]> tooltip) {
+        this.tooltipSupplier = () -> tooltip;
+        return this;
+    }
+    
+    public EnumSelectorBuilder setTooltip(String... tooltip) {
+        this.tooltipSupplier = () -> Optional.ofNullable(tooltip);
+        return this;
+    }
+    
     public EnumSelectorBuilder setEnumNameProvider(Function<Enum, String> enumNameProvider) {
         Objects.requireNonNull(enumNameProvider);
         this.enumNameProvider = enumNameProvider;
@@ -47,8 +62,8 @@ public class EnumSelectorBuilder<T extends Enum<?>> extends FieldBuilder<T> {
     }
     
     @Override
-    public AbstractConfigListEntry buildEntry() {
-        return new EnumListEntry(getFieldNameKey(), clazz, value, getResetButtonKey(), defaultValue, saveConsumer, enumNameProvider, tooltipSupplier);
+    public EnumListEntry<T> build() {
+        return new EnumListEntry<T>(getFieldNameKey(), clazz, value, getResetButtonKey(), defaultValue, saveConsumer, enumNameProvider, tooltipSupplier);
     }
     
 }

+ 6 - 2
src/main/java/me/shedaniel/clothconfig2/impl/builders/FieldBuilder.java

@@ -4,7 +4,7 @@ import me.shedaniel.clothconfig2.api.AbstractConfigListEntry;
 
 import java.util.function.Supplier;
 
-public abstract class FieldBuilder<T> {
+public abstract class FieldBuilder<T, A extends AbstractConfigListEntry> {
     private final String fieldNameKey;
     private final String resetButtonKey;
     protected Supplier<T> defaultValue = null;
@@ -18,7 +18,11 @@ public abstract class FieldBuilder<T> {
         return defaultValue;
     }
     
-    public abstract AbstractConfigListEntry buildEntry();
+    public final AbstractConfigListEntry buildEntry() {
+        return build();
+    }
+    
+    public abstract A build();
     
     public final String getFieldNameKey() {
         return fieldNameKey;

+ 17 - 3
src/main/java/me/shedaniel/clothconfig2/impl/builders/FloatFieldBuilder.java

@@ -1,13 +1,12 @@
 package me.shedaniel.clothconfig2.impl.builders;
 
-import me.shedaniel.clothconfig2.api.AbstractConfigListEntry;
 import me.shedaniel.clothconfig2.gui.entries.FloatListEntry;
 
 import java.util.Optional;
 import java.util.function.Consumer;
 import java.util.function.Supplier;
 
-public class FloatFieldBuilder extends FieldBuilder<Float> {
+public class FloatFieldBuilder extends FieldBuilder<Float, FloatListEntry> {
     
     private Consumer<Float> saveConsumer = null;
     private Supplier<Optional<String[]>> tooltipSupplier = null;
@@ -29,11 +28,26 @@ public class FloatFieldBuilder extends FieldBuilder<Float> {
         return this;
     }
     
+    public FloatFieldBuilder setDefaultValue(float defaultValue) {
+        this.defaultValue = () -> defaultValue;
+        return this;
+    }
+    
     public FloatFieldBuilder setTooltipSupplier(Supplier<Optional<String[]>> tooltipSupplier) {
         this.tooltipSupplier = tooltipSupplier;
         return this;
     }
     
+    public FloatFieldBuilder setTooltip(Optional<String[]> tooltip) {
+        this.tooltipSupplier = () -> tooltip;
+        return this;
+    }
+    
+    public FloatFieldBuilder setTooltip(String... tooltip) {
+        this.tooltipSupplier = () -> Optional.ofNullable(tooltip);
+        return this;
+    }
+    
     public FloatFieldBuilder setMin(float min) {
         this.min = min;
         return this;
@@ -55,7 +69,7 @@ public class FloatFieldBuilder extends FieldBuilder<Float> {
     }
     
     @Override
-    public AbstractConfigListEntry buildEntry() {
+    public FloatListEntry build() {
         FloatListEntry entry = new FloatListEntry(getFieldNameKey(), value, getResetButtonKey(), defaultValue, saveConsumer, tooltipSupplier);
         if (min != null)
             entry.setMinimum(min);

+ 17 - 3
src/main/java/me/shedaniel/clothconfig2/impl/builders/IntFieldBuilder.java

@@ -1,13 +1,12 @@
 package me.shedaniel.clothconfig2.impl.builders;
 
-import me.shedaniel.clothconfig2.api.AbstractConfigListEntry;
 import me.shedaniel.clothconfig2.gui.entries.IntegerListEntry;
 
 import java.util.Optional;
 import java.util.function.Consumer;
 import java.util.function.Supplier;
 
-public class IntFieldBuilder extends FieldBuilder<Integer> {
+public class IntFieldBuilder extends FieldBuilder<Integer, IntegerListEntry> {
     
     private Consumer<Integer> saveConsumer = null;
     private Supplier<Optional<String[]>> tooltipSupplier = null;
@@ -29,11 +28,26 @@ public class IntFieldBuilder extends FieldBuilder<Integer> {
         return this;
     }
     
+    public IntFieldBuilder setDefaultValue(int defaultValue) {
+        this.defaultValue = () -> defaultValue;
+        return this;
+    }
+    
     public IntFieldBuilder setTooltipSupplier(Supplier<Optional<String[]>> tooltipSupplier) {
         this.tooltipSupplier = tooltipSupplier;
         return this;
     }
     
+    public IntFieldBuilder setTooltip(Optional<String[]> tooltip) {
+        this.tooltipSupplier = () -> tooltip;
+        return this;
+    }
+    
+    public IntFieldBuilder setTooltip(String... tooltip) {
+        this.tooltipSupplier = () -> Optional.ofNullable(tooltip);
+        return this;
+    }
+    
     public IntFieldBuilder setMin(int min) {
         this.min = min;
         return this;
@@ -55,7 +69,7 @@ public class IntFieldBuilder extends FieldBuilder<Integer> {
     }
     
     @Override
-    public AbstractConfigListEntry buildEntry() {
+    public IntegerListEntry build() {
         IntegerListEntry entry = new IntegerListEntry(getFieldNameKey(), value, getResetButtonKey(), defaultValue, saveConsumer, tooltipSupplier);
         if (min != null)
             entry.setMinimum(min);

+ 17 - 3
src/main/java/me/shedaniel/clothconfig2/impl/builders/IntSliderBuilder.java

@@ -1,6 +1,5 @@
 package me.shedaniel.clothconfig2.impl.builders;
 
-import me.shedaniel.clothconfig2.api.AbstractConfigListEntry;
 import me.shedaniel.clothconfig2.gui.entries.IntegerSliderEntry;
 
 import java.util.Optional;
@@ -8,7 +7,7 @@ import java.util.function.Consumer;
 import java.util.function.Function;
 import java.util.function.Supplier;
 
-public class IntSliderBuilder extends FieldBuilder<Integer> {
+public class IntSliderBuilder extends FieldBuilder<Integer, IntegerSliderEntry> {
     
     private Consumer<Integer> saveConsumer = null;
     private Supplier<Optional<String[]>> tooltipSupplier = null;
@@ -37,11 +36,26 @@ public class IntSliderBuilder extends FieldBuilder<Integer> {
         return this;
     }
     
+    public IntSliderBuilder setDefaultValue(int defaultValue) {
+        this.defaultValue = () -> defaultValue;
+        return this;
+    }
+    
     public IntSliderBuilder setTooltipSupplier(Supplier<Optional<String[]>> tooltipSupplier) {
         this.tooltipSupplier = tooltipSupplier;
         return this;
     }
     
+    public IntSliderBuilder setTooltip(Optional<String[]> tooltip) {
+        this.tooltipSupplier = () -> tooltip;
+        return this;
+    }
+    
+    public IntSliderBuilder setTooltip(String... tooltip) {
+        this.tooltipSupplier = () -> Optional.ofNullable(tooltip);
+        return this;
+    }
+    
     public IntSliderBuilder setMax(int max) {
         this.max = max;
         return this;
@@ -53,7 +67,7 @@ public class IntSliderBuilder extends FieldBuilder<Integer> {
     }
     
     @Override
-    public AbstractConfigListEntry buildEntry() {
+    public IntegerSliderEntry build() {
         if (textGetter == null)
             return new IntegerSliderEntry(getFieldNameKey(), min, max, value, getResetButtonKey(), defaultValue, saveConsumer, tooltipSupplier);
         return new IntegerSliderEntry(getFieldNameKey(), min, max, value, getResetButtonKey(), defaultValue, saveConsumer, tooltipSupplier).setTextGetter(textGetter);

+ 17 - 3
src/main/java/me/shedaniel/clothconfig2/impl/builders/LongFieldBuilder.java

@@ -1,13 +1,12 @@
 package me.shedaniel.clothconfig2.impl.builders;
 
-import me.shedaniel.clothconfig2.api.AbstractConfigListEntry;
 import me.shedaniel.clothconfig2.gui.entries.LongListEntry;
 
 import java.util.Optional;
 import java.util.function.Consumer;
 import java.util.function.Supplier;
 
-public class LongFieldBuilder extends FieldBuilder<Long> {
+public class LongFieldBuilder extends FieldBuilder<Long, LongListEntry> {
     
     private Consumer<Long> saveConsumer = null;
     private Supplier<Optional<String[]>> tooltipSupplier = null;
@@ -29,11 +28,26 @@ public class LongFieldBuilder extends FieldBuilder<Long> {
         return this;
     }
     
+    public LongFieldBuilder setDefaultValue(long defaultValue) {
+        this.defaultValue = () -> defaultValue;
+        return this;
+    }
+    
     public LongFieldBuilder setTooltipSupplier(Supplier<Optional<String[]>> tooltipSupplier) {
         this.tooltipSupplier = tooltipSupplier;
         return this;
     }
     
+    public LongFieldBuilder setTooltip(Optional<String[]> tooltip) {
+        this.tooltipSupplier = () -> tooltip;
+        return this;
+    }
+    
+    public LongFieldBuilder setTooltip(String... tooltip) {
+        this.tooltipSupplier = () -> Optional.ofNullable(tooltip);
+        return this;
+    }
+    
     public LongFieldBuilder setMin(long min) {
         this.min = min;
         return this;
@@ -55,7 +69,7 @@ public class LongFieldBuilder extends FieldBuilder<Long> {
     }
     
     @Override
-    public AbstractConfigListEntry buildEntry() {
+    public LongListEntry build() {
         LongListEntry entry = new LongListEntry(getFieldNameKey(), value, getResetButtonKey(), defaultValue, saveConsumer, tooltipSupplier);
         if (min != null)
             entry.setMinimum(min);

+ 17 - 3
src/main/java/me/shedaniel/clothconfig2/impl/builders/LongSliderBuilder.java

@@ -1,6 +1,5 @@
 package me.shedaniel.clothconfig2.impl.builders;
 
-import me.shedaniel.clothconfig2.api.AbstractConfigListEntry;
 import me.shedaniel.clothconfig2.gui.entries.LongSliderEntry;
 
 import java.util.Optional;
@@ -8,7 +7,7 @@ import java.util.function.Consumer;
 import java.util.function.Function;
 import java.util.function.Supplier;
 
-public class LongSliderBuilder extends FieldBuilder<Long> {
+public class LongSliderBuilder extends FieldBuilder<Long, LongSliderEntry> {
     
     private Consumer<Long> saveConsumer = null;
     private Supplier<Optional<String[]>> tooltipSupplier = null;
@@ -37,13 +36,28 @@ public class LongSliderBuilder extends FieldBuilder<Long> {
         return this;
     }
     
+    public LongSliderBuilder setDefaultValue(long defaultValue) {
+        this.defaultValue = () -> defaultValue;
+        return this;
+    }
+    
     public LongSliderBuilder setTooltipSupplier(Supplier<Optional<String[]>> tooltipSupplier) {
         this.tooltipSupplier = tooltipSupplier;
         return this;
     }
     
+    public LongSliderBuilder setTooltip(Optional<String[]> tooltip) {
+        this.tooltipSupplier = () -> tooltip;
+        return this;
+    }
+    
+    public LongSliderBuilder setTooltip(String... tooltip) {
+        this.tooltipSupplier = () -> Optional.ofNullable(tooltip);
+        return this;
+    }
+    
     @Override
-    public AbstractConfigListEntry buildEntry() {
+    public LongSliderEntry build() {
         if (textGetter == null)
             return new LongSliderEntry(getFieldNameKey(), min, max, value, saveConsumer, getResetButtonKey(), defaultValue, tooltipSupplier);
         return new LongSliderEntry(getFieldNameKey(), min, max, value, saveConsumer, getResetButtonKey(), defaultValue, tooltipSupplier).setTextGetter(textGetter);

+ 12 - 2
src/main/java/me/shedaniel/clothconfig2/impl/builders/SubCategoryBuilder.java

@@ -7,7 +7,7 @@ import me.shedaniel.clothconfig2.gui.entries.SubCategoryListEntry;
 import java.util.*;
 import java.util.function.Supplier;
 
-public class SubCategoryBuilder extends FieldBuilder implements List<AbstractConfigListEntry> {
+public class SubCategoryBuilder extends FieldBuilder<Object, SubCategoryListEntry> implements List<AbstractConfigListEntry> {
     
     private List<AbstractConfigListEntry> entries;
     private Supplier<Optional<String[]>> tooltipSupplier = null;
@@ -23,13 +23,23 @@ public class SubCategoryBuilder extends FieldBuilder implements List<AbstractCon
         return this;
     }
     
+    public SubCategoryBuilder setTooltip(Optional<String[]> tooltip) {
+        this.tooltipSupplier = () -> tooltip;
+        return this;
+    }
+    
+    public SubCategoryBuilder setTooltip(String... tooltip) {
+        this.tooltipSupplier = () -> Optional.ofNullable(tooltip);
+        return this;
+    }
+    
     public SubCategoryBuilder setExpended(boolean expended) {
         this.expended = expended;
         return this;
     }
     
     @Override
-    public AbstractConfigListEntry buildEntry() {
+    public SubCategoryListEntry build() {
         SubCategoryListEntry entry = new SubCategoryListEntry(getFieldNameKey(), entries, expended);
         entry.setTooltipSupplier(tooltipSupplier);
         return entry;

+ 12 - 3
src/main/java/me/shedaniel/clothconfig2/impl/builders/TextDescriptionBuilder.java

@@ -1,12 +1,11 @@
 package me.shedaniel.clothconfig2.impl.builders;
 
-import me.shedaniel.clothconfig2.api.AbstractConfigListEntry;
 import me.shedaniel.clothconfig2.gui.entries.TextListEntry;
 
 import java.util.Optional;
 import java.util.function.Supplier;
 
-public class TextDescriptionBuilder extends FieldBuilder {
+public class TextDescriptionBuilder extends FieldBuilder<String, TextListEntry> {
     
     private int color = -1;
     private Supplier<Optional<String[]>> tooltipSupplier = null;
@@ -22,13 +21,23 @@ public class TextDescriptionBuilder extends FieldBuilder {
         return this;
     }
     
+    public TextDescriptionBuilder setTooltip(Optional<String[]> tooltip) {
+        this.tooltipSupplier = () -> tooltip;
+        return this;
+    }
+    
+    public TextDescriptionBuilder setTooltip(String... tooltip) {
+        this.tooltipSupplier = () -> Optional.ofNullable(tooltip);
+        return this;
+    }
+    
     public TextDescriptionBuilder setColor(int color) {
         this.color = color;
         return this;
     }
     
     @Override
-    public AbstractConfigListEntry buildEntry() {
+    public TextListEntry build() {
         return new TextListEntry(getFieldNameKey(), value, color, tooltipSupplier);
     }
     

+ 17 - 3
src/main/java/me/shedaniel/clothconfig2/impl/builders/TextFieldBuilder.java

@@ -1,6 +1,5 @@
 package me.shedaniel.clothconfig2.impl.builders;
 
-import me.shedaniel.clothconfig2.api.AbstractConfigListEntry;
 import me.shedaniel.clothconfig2.gui.entries.StringListEntry;
 
 import java.util.Objects;
@@ -8,7 +7,7 @@ import java.util.Optional;
 import java.util.function.Consumer;
 import java.util.function.Supplier;
 
-public class TextFieldBuilder extends FieldBuilder<String> {
+public class TextFieldBuilder extends FieldBuilder<String, StringListEntry> {
     
     private Consumer<String> saveConsumer = null;
     private Supplier<Optional<String[]>> tooltipSupplier = null;
@@ -30,13 +29,28 @@ public class TextFieldBuilder extends FieldBuilder<String> {
         return this;
     }
     
+    public TextFieldBuilder setDefaultValue(String defaultValue) {
+        this.defaultValue = () -> Objects.requireNonNull(defaultValue);
+        return this;
+    }
+    
     public TextFieldBuilder setTooltipSupplier(Supplier<Optional<String[]>> tooltipSupplier) {
         this.tooltipSupplier = tooltipSupplier;
         return this;
     }
     
+    public TextFieldBuilder setTooltip(Optional<String[]> tooltip) {
+        this.tooltipSupplier = () -> tooltip;
+        return this;
+    }
+    
+    public TextFieldBuilder setTooltip(String... tooltip) {
+        this.tooltipSupplier = () -> Optional.ofNullable(tooltip);
+        return this;
+    }
+    
     @Override
-    public AbstractConfigListEntry buildEntry() {
+    public StringListEntry build() {
         return new StringListEntry(getFieldNameKey(), value, getResetButtonKey(), defaultValue, saveConsumer, tooltipSupplier);
     }