diff options
author | isxander <xander@isxander.dev> | 2024-04-11 18:43:06 +0100 |
---|---|---|
committer | isxander <xander@isxander.dev> | 2024-04-11 18:43:06 +0100 |
commit | 04fe933f4c24817100f3101f088accf55a621f8a (patch) | |
tree | feff94ca3ab4484160e69a24f4ee38522381950e /common/src/main/java/dev/isxander/yacl3/impl/controller | |
parent | 831b894fdb7fe3e173d81387c8f6a2402b8ccfa9 (diff) | |
download | YetAnotherConfigLib-04fe933f4c24817100f3101f088accf55a621f8a.tar.gz YetAnotherConfigLib-04fe933f4c24817100f3101f088accf55a621f8a.tar.bz2 YetAnotherConfigLib-04fe933f4c24817100f3101f088accf55a621f8a.zip |
Extremely fragile and broken multiversion build with stonecutter
Diffstat (limited to 'common/src/main/java/dev/isxander/yacl3/impl/controller')
18 files changed, 0 insertions, 687 deletions
diff --git a/common/src/main/java/dev/isxander/yacl3/impl/controller/AbstractControllerBuilderImpl.java b/common/src/main/java/dev/isxander/yacl3/impl/controller/AbstractControllerBuilderImpl.java deleted file mode 100644 index 66c025a..0000000 --- a/common/src/main/java/dev/isxander/yacl3/impl/controller/AbstractControllerBuilderImpl.java +++ /dev/null @@ -1,12 +0,0 @@ -package dev.isxander.yacl3.impl.controller; - -import dev.isxander.yacl3.api.Option; -import dev.isxander.yacl3.api.controller.ControllerBuilder; - -public abstract class AbstractControllerBuilderImpl<T> implements ControllerBuilder<T> { - protected final Option<T> option; - - protected AbstractControllerBuilderImpl(Option<T> option) { - this.option = option; - } -} diff --git a/common/src/main/java/dev/isxander/yacl3/impl/controller/BooleanControllerBuilderImpl.java b/common/src/main/java/dev/isxander/yacl3/impl/controller/BooleanControllerBuilderImpl.java deleted file mode 100644 index 063a177..0000000 --- a/common/src/main/java/dev/isxander/yacl3/impl/controller/BooleanControllerBuilderImpl.java +++ /dev/null @@ -1,57 +0,0 @@ -package dev.isxander.yacl3.impl.controller; - -import dev.isxander.yacl3.api.Controller; -import dev.isxander.yacl3.api.Option; -import dev.isxander.yacl3.api.controller.BooleanControllerBuilder; -import dev.isxander.yacl3.api.controller.ValueFormatter; -import dev.isxander.yacl3.gui.controllers.BooleanController; -import net.minecraft.network.chat.Component; -import org.apache.commons.lang3.Validate; - -import java.util.function.Function; - -public class BooleanControllerBuilderImpl extends AbstractControllerBuilderImpl<Boolean> implements BooleanControllerBuilder { - private boolean coloured = false; - private ValueFormatter<Boolean> formatter = BooleanController.ON_OFF_FORMATTER::apply; - - public BooleanControllerBuilderImpl(Option<Boolean> option) { - super(option); - } - - @Override - public BooleanControllerBuilder coloured(boolean coloured) { - this.coloured = coloured; - return this; - } - - @Override - public BooleanControllerBuilder formatValue(ValueFormatter<Boolean> formatter) { - Validate.notNull(formatter, "formatter cannot be null"); - - this.formatter = formatter; - return this; - } - - @Override - public BooleanControllerBuilder onOffFormatter() { - this.formatter = BooleanController.ON_OFF_FORMATTER::apply; - return this; - } - - @Override - public BooleanControllerBuilder yesNoFormatter() { - this.formatter = BooleanController.YES_NO_FORMATTER::apply; - return this; - } - - @Override - public BooleanControllerBuilder trueFalseFormatter() { - this.formatter = BooleanController.TRUE_FALSE_FORMATTER::apply; - return this; - } - - @Override - public Controller<Boolean> build() { - return BooleanController.createInternal(option, formatter, coloured); - } -} diff --git a/common/src/main/java/dev/isxander/yacl3/impl/controller/ColorControllerBuilderImpl.java b/common/src/main/java/dev/isxander/yacl3/impl/controller/ColorControllerBuilderImpl.java deleted file mode 100644 index 9412165..0000000 --- a/common/src/main/java/dev/isxander/yacl3/impl/controller/ColorControllerBuilderImpl.java +++ /dev/null @@ -1,27 +0,0 @@ -package dev.isxander.yacl3.impl.controller; - -import dev.isxander.yacl3.api.Controller; -import dev.isxander.yacl3.api.Option; -import dev.isxander.yacl3.api.controller.ColorControllerBuilder; -import dev.isxander.yacl3.gui.controllers.ColorController; - -import java.awt.Color; - -public class ColorControllerBuilderImpl extends AbstractControllerBuilderImpl<Color> implements ColorControllerBuilder { - private boolean allowAlpha = false; - - public ColorControllerBuilderImpl(Option<Color> option) { - super(option); - } - - @Override - public ColorControllerBuilder allowAlpha(boolean allowAlpha) { - this.allowAlpha = allowAlpha; - return this; - } - - @Override - public Controller<Color> build() { - return new ColorController(option, allowAlpha); - } -} diff --git a/common/src/main/java/dev/isxander/yacl3/impl/controller/CyclingListControllerBuilderImpl.java b/common/src/main/java/dev/isxander/yacl3/impl/controller/CyclingListControllerBuilderImpl.java deleted file mode 100644 index 8e2e481..0000000 --- a/common/src/main/java/dev/isxander/yacl3/impl/controller/CyclingListControllerBuilderImpl.java +++ /dev/null @@ -1,41 +0,0 @@ -package dev.isxander.yacl3.impl.controller; - -import com.google.common.collect.ImmutableList; -import dev.isxander.yacl3.api.Controller; -import dev.isxander.yacl3.api.Option; -import dev.isxander.yacl3.api.controller.CyclingListControllerBuilder; -import dev.isxander.yacl3.api.controller.ValueFormatter; -import dev.isxander.yacl3.gui.controllers.cycling.CyclingListController; - -public final class CyclingListControllerBuilderImpl<T> extends AbstractControllerBuilderImpl<T> implements CyclingListControllerBuilder<T> { - private Iterable<? extends T> values; - private ValueFormatter<T> formatter = null; - - public CyclingListControllerBuilderImpl(Option<T> option) { - super(option); - } - - @Override - public CyclingListControllerBuilder<T> values(Iterable<? extends T> values) { - this.values = values; - return this; - } - - @SafeVarargs - @Override - public final CyclingListControllerBuilder<T> values(T... values) { - this.values = ImmutableList.copyOf(values); - return this; - } - - @Override - public CyclingListControllerBuilder<T> formatValue(ValueFormatter<T> formatter) { - this.formatter = formatter; - return this; - } - - @Override - public Controller<T> build() { - return CyclingListController.createInternal(option, values, formatter); - } -} diff --git a/common/src/main/java/dev/isxander/yacl3/impl/controller/DoubleFieldControllerBuilderImpl.java b/common/src/main/java/dev/isxander/yacl3/impl/controller/DoubleFieldControllerBuilderImpl.java deleted file mode 100644 index 8d84e7d..0000000 --- a/common/src/main/java/dev/isxander/yacl3/impl/controller/DoubleFieldControllerBuilderImpl.java +++ /dev/null @@ -1,51 +0,0 @@ -package dev.isxander.yacl3.impl.controller; - -import dev.isxander.yacl3.api.Controller; -import dev.isxander.yacl3.api.Option; -import dev.isxander.yacl3.api.controller.DoubleFieldControllerBuilder; -import dev.isxander.yacl3.api.controller.ValueFormatter; -import dev.isxander.yacl3.gui.controllers.slider.DoubleSliderController; -import dev.isxander.yacl3.gui.controllers.string.number.DoubleFieldController; -import net.minecraft.network.chat.Component; - -import java.util.function.Function; - -public class DoubleFieldControllerBuilderImpl extends AbstractControllerBuilderImpl<Double> implements DoubleFieldControllerBuilder { - private double min = Double.MIN_VALUE; - private double max = Double.MAX_VALUE; - private ValueFormatter<Double> formatter = DoubleSliderController.DEFAULT_FORMATTER::apply; - - public DoubleFieldControllerBuilderImpl(Option<Double> option) { - super(option); - } - - @Override - public DoubleFieldControllerBuilder min(Double min) { - this.min = min; - return this; - } - - @Override - public DoubleFieldControllerBuilder max(Double max) { - this.max = max; - return this; - } - - @Override - public DoubleFieldControllerBuilder range(Double min, Double max) { - this.min = min; - this.max = max; - return this; - } - - @Override - public DoubleFieldControllerBuilder formatValue(ValueFormatter<Double> formatter) { - this.formatter = formatter; - return this; - } - - @Override - public Controller<Double> build() { - return DoubleFieldController.createInternal(option, min, max, formatter); - } -} diff --git a/common/src/main/java/dev/isxander/yacl3/impl/controller/DoubleSliderControllerBuilderImpl.java b/common/src/main/java/dev/isxander/yacl3/impl/controller/DoubleSliderControllerBuilderImpl.java deleted file mode 100644 index b696d57..0000000 --- a/common/src/main/java/dev/isxander/yacl3/impl/controller/DoubleSliderControllerBuilderImpl.java +++ /dev/null @@ -1,44 +0,0 @@ -package dev.isxander.yacl3.impl.controller; - -import dev.isxander.yacl3.api.Controller; -import dev.isxander.yacl3.api.Option; -import dev.isxander.yacl3.api.controller.DoubleSliderControllerBuilder; -import dev.isxander.yacl3.api.controller.ValueFormatter; -import dev.isxander.yacl3.gui.controllers.slider.DoubleSliderController; -import net.minecraft.network.chat.Component; - -import java.util.function.Function; - -public class DoubleSliderControllerBuilderImpl extends AbstractControllerBuilderImpl<Double> implements DoubleSliderControllerBuilder { - private double min, max; - private double step; - private ValueFormatter<Double> formatter = DoubleSliderController.DEFAULT_FORMATTER::apply; - - public DoubleSliderControllerBuilderImpl(Option<Double> option) { - super(option); - } - - @Override - public DoubleSliderControllerBuilder range(Double min, Double max) { - this.min = min; - this.max = max; - return this; - } - - @Override - public DoubleSliderControllerBuilder step(Double step) { - this.step = step; - return this; - } - - @Override - public DoubleSliderControllerBuilder formatValue(ValueFormatter<Double> formatter) { - this.formatter = formatter; - return this; - } - - @Override - public Controller<Double> build() { - return DoubleSliderController.createInternal(option, min, max, step, formatter); - } -} diff --git a/common/src/main/java/dev/isxander/yacl3/impl/controller/DropdownStringControllerBuilderImpl.java b/common/src/main/java/dev/isxander/yacl3/impl/controller/DropdownStringControllerBuilderImpl.java deleted file mode 100644 index b300a6a..0000000 --- a/common/src/main/java/dev/isxander/yacl3/impl/controller/DropdownStringControllerBuilderImpl.java +++ /dev/null @@ -1,49 +0,0 @@ -package dev.isxander.yacl3.impl.controller; - -import dev.isxander.yacl3.api.Controller; -import dev.isxander.yacl3.api.Option; -import dev.isxander.yacl3.api.controller.DropdownStringControllerBuilder; -import dev.isxander.yacl3.gui.controllers.dropdown.DropdownStringController; - -import java.util.Arrays; -import java.util.List; - -public class DropdownStringControllerBuilderImpl extends StringControllerBuilderImpl implements DropdownStringControllerBuilder { - private List<String> values; - private boolean allowEmptyValue = false; - private boolean allowAnyValue = false; - - public DropdownStringControllerBuilderImpl(Option<String> option) { - super(option); - } - - @Override - public DropdownStringControllerBuilder values(List<String> values) { - this.values = values; - return this; - } - - @Override - public DropdownStringControllerBuilderImpl values(String... values) { - this.values = Arrays.asList(values); - return this; - } - - @Override - public DropdownStringControllerBuilderImpl allowEmptyValue(boolean allowEmptyValue) { - this.allowEmptyValue = allowEmptyValue; - return this; - } - - @Override - public DropdownStringControllerBuilderImpl allowAnyValue(boolean allowAnyValue) { - this.allowAnyValue = allowAnyValue; - return this; - } - - @Override - public Controller<String> build() { - return new DropdownStringController(option, values, allowEmptyValue, allowAnyValue); - } - -} diff --git a/common/src/main/java/dev/isxander/yacl3/impl/controller/EnumControllerBuilderImpl.java b/common/src/main/java/dev/isxander/yacl3/impl/controller/EnumControllerBuilderImpl.java deleted file mode 100644 index 04ee2a0..0000000 --- a/common/src/main/java/dev/isxander/yacl3/impl/controller/EnumControllerBuilderImpl.java +++ /dev/null @@ -1,42 +0,0 @@ -package dev.isxander.yacl3.impl.controller; - -import dev.isxander.yacl3.api.Controller; -import dev.isxander.yacl3.api.Option; -import dev.isxander.yacl3.api.controller.EnumControllerBuilder; -import dev.isxander.yacl3.api.controller.ValueFormatter; -import dev.isxander.yacl3.gui.controllers.cycling.EnumController; -import net.minecraft.network.chat.Component; - -import java.util.function.Function; - -public class EnumControllerBuilderImpl<T extends Enum<T>> extends AbstractControllerBuilderImpl<T> implements EnumControllerBuilder<T> { - private Class<T> enumClass; - private ValueFormatter<T> formatter = null; - - public EnumControllerBuilderImpl(Option<T> option) { - super(option); - } - - @Override - public EnumControllerBuilder<T> enumClass(Class<T> enumClass) { - this.enumClass = enumClass; - return this; - } - - @Override - public EnumControllerBuilder<T> formatValue(ValueFormatter<T> formatter) { - this.formatter = formatter; - return this; - } - - @Override - public Controller<T> build() { - ValueFormatter<T> formatter = this.formatter; - if (formatter == null) { - Function<T, Component> formatFunction = EnumController.getDefaultFormatter(); - formatter = formatFunction::apply; - } - - return EnumController.createInternal(option, formatter, enumClass.getEnumConstants()); - } -} diff --git a/common/src/main/java/dev/isxander/yacl3/impl/controller/EnumDropdownControllerBuilderImpl.java b/common/src/main/java/dev/isxander/yacl3/impl/controller/EnumDropdownControllerBuilderImpl.java deleted file mode 100644 index 4ac063f..0000000 --- a/common/src/main/java/dev/isxander/yacl3/impl/controller/EnumDropdownControllerBuilderImpl.java +++ /dev/null @@ -1,27 +0,0 @@ -package dev.isxander.yacl3.impl.controller; - -import dev.isxander.yacl3.api.Controller; -import dev.isxander.yacl3.api.Option; -import dev.isxander.yacl3.api.controller.EnumDropdownControllerBuilder; -import dev.isxander.yacl3.api.controller.ValueFormatter; -import dev.isxander.yacl3.gui.controllers.cycling.EnumController; -import dev.isxander.yacl3.gui.controllers.dropdown.EnumDropdownController; - -public class EnumDropdownControllerBuilderImpl<E extends Enum<E>> extends AbstractControllerBuilderImpl<E> implements EnumDropdownControllerBuilder<E> { - private ValueFormatter<E> formatter = EnumController.<E>getDefaultFormatter()::apply; - - public EnumDropdownControllerBuilderImpl(Option<E> option) { - super(option); - } - - @Override - public EnumDropdownControllerBuilder<E> formatValue(ValueFormatter<E> formatter) { - this.formatter = formatter; - return this; - } - - @Override - public Controller<E> build() { - return new EnumDropdownController<>(option, formatter); - } -} diff --git a/common/src/main/java/dev/isxander/yacl3/impl/controller/FloatFieldControllerBuilderImpl.java b/common/src/main/java/dev/isxander/yacl3/impl/controller/FloatFieldControllerBuilderImpl.java deleted file mode 100644 index 08fefd0..0000000 --- a/common/src/main/java/dev/isxander/yacl3/impl/controller/FloatFieldControllerBuilderImpl.java +++ /dev/null @@ -1,51 +0,0 @@ -package dev.isxander.yacl3.impl.controller; - -import dev.isxander.yacl3.api.Controller; -import dev.isxander.yacl3.api.Option; -import dev.isxander.yacl3.api.controller.FloatFieldControllerBuilder; -import dev.isxander.yacl3.api.controller.ValueFormatter; -import dev.isxander.yacl3.gui.controllers.slider.FloatSliderController; -import dev.isxander.yacl3.gui.controllers.string.number.FloatFieldController; -import net.minecraft.network.chat.Component; - -import java.util.function.Function; - -public class FloatFieldControllerBuilderImpl extends AbstractControllerBuilderImpl<Float> implements FloatFieldControllerBuilder { - private float min = Float.MIN_VALUE; - private float max = Float.MAX_VALUE; - private ValueFormatter<Float> formatter = FloatSliderController.DEFAULT_FORMATTER::apply; - - public FloatFieldControllerBuilderImpl(Option<Float> option) { - super(option); - } - - @Override - public FloatFieldControllerBuilder min(Float min) { - this.min = min; - return this; - } - - @Override - public FloatFieldControllerBuilder max(Float max) { - this.max = max; - return this; - } - - @Override - public FloatFieldControllerBuilder range(Float min, Float max) { - this.min = min; - this.max = max; - return this; - } - - @Override - public FloatFieldControllerBuilder formatValue(ValueFormatter<Float> formatter) { - this.formatter = formatter; - return this; - } - - @Override - public Controller<Float> build() { - return FloatFieldController.createInternal(option, min, max, formatter); - } -} diff --git a/common/src/main/java/dev/isxander/yacl3/impl/controller/FloatSliderControllerBuilderImpl.java b/common/src/main/java/dev/isxander/yacl3/impl/controller/FloatSliderControllerBuilderImpl.java deleted file mode 100644 index 9b2d75b..0000000 --- a/common/src/main/java/dev/isxander/yacl3/impl/controller/FloatSliderControllerBuilderImpl.java +++ /dev/null @@ -1,44 +0,0 @@ -package dev.isxander.yacl3.impl.controller; - -import dev.isxander.yacl3.api.Controller; -import dev.isxander.yacl3.api.Option; -import dev.isxander.yacl3.api.controller.FloatSliderControllerBuilder; -import dev.isxander.yacl3.api.controller.ValueFormatter; -import dev.isxander.yacl3.gui.controllers.slider.FloatSliderController; -import net.minecraft.network.chat.Component; - -import java.util.function.Function; - -public class FloatSliderControllerBuilderImpl extends AbstractControllerBuilderImpl<Float> implements FloatSliderControllerBuilder { - private float min, max; - private float step; - private ValueFormatter<Float> formatter = FloatSliderController.DEFAULT_FORMATTER::apply; - - public FloatSliderControllerBuilderImpl(Option<Float> option) { - super(option); - } - - @Override - public FloatSliderControllerBuilder range(Float min, Float max) { - this.min = min; - this.max = max; - return this; - } - - @Override - public FloatSliderControllerBuilder step(Float step) { - this.step = step; - return this; - } - - @Override - public FloatSliderControllerBuilder formatValue(ValueFormatter<Float> formatter) { - this.formatter = formatter; - return this; - } - - @Override - public Controller<Float> build() { - return FloatSliderController.createInternal(option, min, max, step, formatter); - } -} diff --git a/common/src/main/java/dev/isxander/yacl3/impl/controller/IntegerFieldControllerBuilderImpl.java b/common/src/main/java/dev/isxander/yacl3/impl/controller/IntegerFieldControllerBuilderImpl.java deleted file mode 100644 index 1435c49..0000000 --- a/common/src/main/java/dev/isxander/yacl3/impl/controller/IntegerFieldControllerBuilderImpl.java +++ /dev/null @@ -1,51 +0,0 @@ -package dev.isxander.yacl3.impl.controller; - -import dev.isxander.yacl3.api.Controller; -import dev.isxander.yacl3.api.Option; -import dev.isxander.yacl3.api.controller.IntegerFieldControllerBuilder; -import dev.isxander.yacl3.api.controller.ValueFormatter; -import dev.isxander.yacl3.gui.controllers.slider.IntegerSliderController; -import dev.isxander.yacl3.gui.controllers.string.number.IntegerFieldController; -import net.minecraft.network.chat.Component; - -import java.util.function.Function; - -public class IntegerFieldControllerBuilderImpl extends AbstractControllerBuilderImpl<Integer> implements IntegerFieldControllerBuilder { - private int min = Integer.MIN_VALUE; - private int max = Integer.MAX_VALUE; - private ValueFormatter<Integer> formatter = IntegerSliderController.DEFAULT_FORMATTER::apply; - - public IntegerFieldControllerBuilderImpl(Option<Integer> option) { - super(option); - } - - @Override - public IntegerFieldControllerBuilder min(Integer min) { - this.min = min; - return this; - } - - @Override - public IntegerFieldControllerBuilder max(Integer max) { - this.max = max; - return this; - } - - @Override - public IntegerFieldControllerBuilder range(Integer min, Integer max) { - this.min = min; - this.max = max; - return this; - } - - @Override - public IntegerFieldControllerBuilder formatValue(ValueFormatter<Integer> formatter) { - this.formatter = formatter; - return this; - } - - @Override - public Controller<Integer> build() { - return IntegerFieldController.createInternal(option, min, max, formatter); - } -} diff --git a/common/src/main/java/dev/isxander/yacl3/impl/controller/IntegerSliderControllerBuilderImpl.java b/common/src/main/java/dev/isxander/yacl3/impl/controller/IntegerSliderControllerBuilderImpl.java deleted file mode 100644 index b9395a0..0000000 --- a/common/src/main/java/dev/isxander/yacl3/impl/controller/IntegerSliderControllerBuilderImpl.java +++ /dev/null @@ -1,44 +0,0 @@ -package dev.isxander.yacl3.impl.controller; - -import dev.isxander.yacl3.api.Controller; -import dev.isxander.yacl3.api.Option; -import dev.isxander.yacl3.api.controller.IntegerSliderControllerBuilder; -import dev.isxander.yacl3.api.controller.ValueFormatter; -import dev.isxander.yacl3.gui.controllers.slider.IntegerSliderController; -import net.minecraft.network.chat.Component; - -import java.util.function.Function; - -public class IntegerSliderControllerBuilderImpl extends AbstractControllerBuilderImpl<Integer> implements IntegerSliderControllerBuilder { - private int min, max; - private int step; - private ValueFormatter<Integer> formatter = IntegerSliderController.DEFAULT_FORMATTER::apply; - - public IntegerSliderControllerBuilderImpl(Option<Integer> option) { - super(option); - } - - @Override - public IntegerSliderControllerBuilder range(Integer min, Integer max) { - this.min = min; - this.max = max; - return this; - } - - @Override - public IntegerSliderControllerBuilder step(Integer step) { - this.step = step; - return this; - } - - @Override - public IntegerSliderControllerBuilder formatValue(ValueFormatter<Integer> formatter) { - this.formatter = formatter; - return this; - } - - @Override - public Controller<Integer> build() { - return IntegerSliderController.createInternal(option, min, max, step, formatter); - } -} diff --git a/common/src/main/java/dev/isxander/yacl3/impl/controller/ItemControllerBuilderImpl.java b/common/src/main/java/dev/isxander/yacl3/impl/controller/ItemControllerBuilderImpl.java deleted file mode 100644 index 9a817fb..0000000 --- a/common/src/main/java/dev/isxander/yacl3/impl/controller/ItemControllerBuilderImpl.java +++ /dev/null @@ -1,18 +0,0 @@ -package dev.isxander.yacl3.impl.controller; - -import dev.isxander.yacl3.api.Controller; -import dev.isxander.yacl3.api.Option; -import dev.isxander.yacl3.api.controller.ItemControllerBuilder; -import dev.isxander.yacl3.gui.controllers.dropdown.ItemController; -import net.minecraft.world.item.Item; - -public class ItemControllerBuilderImpl extends AbstractControllerBuilderImpl<Item> implements ItemControllerBuilder { - public ItemControllerBuilderImpl(Option<Item> option) { - super(option); - } - - @Override - public Controller<Item> build() { - return new ItemController(option); - } -} diff --git a/common/src/main/java/dev/isxander/yacl3/impl/controller/LongFieldControllerBuilderImpl.java b/common/src/main/java/dev/isxander/yacl3/impl/controller/LongFieldControllerBuilderImpl.java deleted file mode 100644 index c7a3ea4..0000000 --- a/common/src/main/java/dev/isxander/yacl3/impl/controller/LongFieldControllerBuilderImpl.java +++ /dev/null @@ -1,51 +0,0 @@ -package dev.isxander.yacl3.impl.controller; - -import dev.isxander.yacl3.api.Controller; -import dev.isxander.yacl3.api.Option; -import dev.isxander.yacl3.api.controller.LongFieldControllerBuilder; -import dev.isxander.yacl3.api.controller.ValueFormatter; -import dev.isxander.yacl3.gui.controllers.slider.LongSliderController; -import dev.isxander.yacl3.gui.controllers.string.number.LongFieldController; -import net.minecraft.network.chat.Component; - -import java.util.function.Function; - -public class LongFieldControllerBuilderImpl extends AbstractControllerBuilderImpl<Long> implements LongFieldControllerBuilder { - private long min = Long.MIN_VALUE; - private long max = Long.MAX_VALUE; - private ValueFormatter<Long> formatter = LongSliderController.DEFAULT_FORMATTER::apply; - - public LongFieldControllerBuilderImpl(Option<Long> option) { - super(option); - } - - @Override - public LongFieldControllerBuilder min(Long min) { - this.min = min; - return this; - } - - @Override - public LongFieldControllerBuilder max(Long max) { - this.max = max; - return this; - } - - @Override - public LongFieldControllerBuilder range(Long min, Long max) { - this.min = min; - this.max = max; - return this; - } - - @Override - public LongFieldControllerBuilder formatValue(ValueFormatter<Long> formatter) { - this.formatter = formatter; - return this; - } - - @Override - public Controller<Long> build() { - return LongFieldController.createInternal(option, min, max, formatter); - } -} diff --git a/common/src/main/java/dev/isxander/yacl3/impl/controller/LongSliderControllerBuilderImpl.java b/common/src/main/java/dev/isxander/yacl3/impl/controller/LongSliderControllerBuilderImpl.java deleted file mode 100644 index 5eda424..0000000 --- a/common/src/main/java/dev/isxander/yacl3/impl/controller/LongSliderControllerBuilderImpl.java +++ /dev/null @@ -1,44 +0,0 @@ -package dev.isxander.yacl3.impl.controller; - -import dev.isxander.yacl3.api.Controller; -import dev.isxander.yacl3.api.Option; -import dev.isxander.yacl3.api.controller.LongSliderControllerBuilder; -import dev.isxander.yacl3.api.controller.ValueFormatter; -import dev.isxander.yacl3.gui.controllers.slider.LongSliderController; -import net.minecraft.network.chat.Component; - -import java.util.function.Function; - -public class LongSliderControllerBuilderImpl extends AbstractControllerBuilderImpl<Long> implements LongSliderControllerBuilder { - private long min, max; - private long step; - private ValueFormatter<Long> formatter = LongSliderController.DEFAULT_FORMATTER::apply; - - public LongSliderControllerBuilderImpl(Option<Long> option) { - super(option); - } - - @Override - public LongSliderControllerBuilder range(Long min, Long max) { - this.min = min; - this.max = max; - return this; - } - - @Override - public LongSliderControllerBuilder step(Long step) { - this.step = step; - return this; - } - - @Override - public LongSliderControllerBuilder formatValue(ValueFormatter<Long> formatter) { - this.formatter = formatter; - return this; - } - - @Override - public Controller<Long> build() { - return LongSliderController.createInternal(option, min, max, step, formatter); - } -} diff --git a/common/src/main/java/dev/isxander/yacl3/impl/controller/StringControllerBuilderImpl.java b/common/src/main/java/dev/isxander/yacl3/impl/controller/StringControllerBuilderImpl.java deleted file mode 100644 index a0f51b9..0000000 --- a/common/src/main/java/dev/isxander/yacl3/impl/controller/StringControllerBuilderImpl.java +++ /dev/null @@ -1,17 +0,0 @@ -package dev.isxander.yacl3.impl.controller; - -import dev.isxander.yacl3.api.Controller; -import dev.isxander.yacl3.api.Option; -import dev.isxander.yacl3.api.controller.StringControllerBuilder; -import dev.isxander.yacl3.gui.controllers.string.StringController; - -public class StringControllerBuilderImpl extends AbstractControllerBuilderImpl<String> implements StringControllerBuilder { - public StringControllerBuilderImpl(Option<String> option) { - super(option); - } - - @Override - public Controller<String> build() { - return new StringController(option); - } -} diff --git a/common/src/main/java/dev/isxander/yacl3/impl/controller/TickBoxControllerBuilderImpl.java b/common/src/main/java/dev/isxander/yacl3/impl/controller/TickBoxControllerBuilderImpl.java deleted file mode 100644 index 3b29719..0000000 --- a/common/src/main/java/dev/isxander/yacl3/impl/controller/TickBoxControllerBuilderImpl.java +++ /dev/null @@ -1,17 +0,0 @@ -package dev.isxander.yacl3.impl.controller; - -import dev.isxander.yacl3.api.Controller; -import dev.isxander.yacl3.api.Option; -import dev.isxander.yacl3.api.controller.TickBoxControllerBuilder; -import dev.isxander.yacl3.gui.controllers.TickBoxController; - -public class TickBoxControllerBuilderImpl extends AbstractControllerBuilderImpl<Boolean> implements TickBoxControllerBuilder { - public TickBoxControllerBuilderImpl(Option<Boolean> option) { - super(option); - } - - @Override - public Controller<Boolean> build() { - return new TickBoxController(option); - } -} |