shedaniel пре 5 година
родитељ
комит
a50b35e217
23 измењених фајлова са 105 додато и 128 уклоњено
  1. 6 24
      build.gradle
  2. 1 1
      gradle.properties
  3. 2 2
      src/main/java/me/shedaniel/clothconfig2/gui/ClothConfigTabButton.java
  4. 1 0
      src/main/java/me/shedaniel/clothconfig2/gui/entries/BaseListEntry.java
  5. 2 3
      src/main/java/me/shedaniel/clothconfig2/gui/entries/BooleanListEntry.java
  6. 3 3
      src/main/java/me/shedaniel/clothconfig2/gui/entries/DoubleListEntry.java
  7. 2 2
      src/main/java/me/shedaniel/clothconfig2/gui/entries/DropdownBoxEntry.java
  8. 4 4
      src/main/java/me/shedaniel/clothconfig2/gui/entries/EnumListEntry.java
  9. 7 7
      src/main/java/me/shedaniel/clothconfig2/gui/entries/FloatListEntry.java
  10. 7 7
      src/main/java/me/shedaniel/clothconfig2/gui/entries/IntegerListEntry.java
  11. 1 2
      src/main/java/me/shedaniel/clothconfig2/gui/entries/IntegerSliderEntry.java
  12. 7 7
      src/main/java/me/shedaniel/clothconfig2/gui/entries/LongListEntry.java
  13. 2 3
      src/main/java/me/shedaniel/clothconfig2/gui/entries/LongSliderEntry.java
  14. 1 1
      src/main/java/me/shedaniel/clothconfig2/gui/entries/MultiElementListEntry.java
  15. 4 3
      src/main/java/me/shedaniel/clothconfig2/gui/entries/SelectionListEntry.java
  16. 1 1
      src/main/java/me/shedaniel/clothconfig2/gui/entries/StringListEntry.java
  17. 5 5
      src/main/java/me/shedaniel/clothconfig2/gui/entries/SubCategoryListEntry.java
  18. 1 2
      src/main/java/me/shedaniel/clothconfig2/gui/entries/TextFieldListEntry.java
  19. 3 3
      src/main/java/me/shedaniel/clothconfig2/gui/entries/TextListEntry.java
  20. 35 36
      src/main/java/me/shedaniel/clothconfig2/gui/widget/DynamicEntryListWidget.java
  21. 6 6
      src/main/java/me/shedaniel/clothconfig2/gui/widget/DynamicSmoothScrollingEntryListWidget.java
  22. 1 3
      src/main/java/me/shedaniel/clothconfig2/impl/ConfigBuilderImpl.java
  23. 3 3
      src/main/java/me/shedaniel/clothconfig2/impl/ConfigEntryBuilderImpl.java

+ 6 - 24
build.gradle

@@ -19,8 +19,7 @@ repositories {
     maven { url "https://jitpack.io" }
 }
 
-sourceCompatibility = 1.8
-targetCompatibility = 1.8
+sourceCompatibility = targetCompatibility = 1.8
 
 group = "me.shedaniel.cloth"
 archivesBaseName = "config-2"
@@ -56,7 +55,7 @@ dependencies {
 
     modImplementation "io.github.prospector:modmenu:${modmenu_version}"
 
-    modImplementation "com.lettuce.fudge:notenoughcrashes-api:1.0.0"
+    modApi "com.lettuce.fudge:notenoughcrashes-api:1.0.0"
     include "com.lettuce.fudge:notenoughcrashes-api:1.0.0"
     modRuntime "com.lettuce.fudge:notenoughcrashes:$nec_version"
 }
@@ -127,26 +126,6 @@ publishing {
             groupId 'me.shedaniel.cloth'
             artifactId 'config-2'
             version = project.version
-            pom.withXml {
-                def root = asNode()
-                root.appendNode('description', 'Cloth Config API for Minecraft')
-                root.appendNode('name', 'config-2')
-                root.appendNode('url', 'https://github.com/shedaniel/ClothConfig')
-                root.appendNode('packaging', 'jar')
-                def license = root.appendNode('licenses').appendNode('license')
-                license.appendNode('name', 'Unlicense')
-                license.appendNode('url', 'http://unlicense.org')
-                license.appendNode('distribution', 'repo')
-                def developers = root.appendNode('developers')
-                def shedaniel = developers.appendNode('developer')
-                shedaniel.appendNode('id', 'shedaniel')
-                shedaniel.appendNode('name', 'shedaniel')
-                shedaniel.appendNode('email', 'daniel@shedaniel.me')
-                def scm = root.appendNode('scm')
-                scm.appendNode('url', "https://github.com/shedaniel/ClothConfig")
-                scm.appendNode('connection', "scm:git:git://github.com/shedaniel/ClothConfig.git")
-                scm.appendNode('developerConnection', "scm:git:ssh://github.com:shedaniel/ClothConfig.git")
-            }
         }
     }
 
@@ -163,14 +142,17 @@ curseforge {
         project {
             id = '319057'
             releaseType = 'release'
+            addGameVersion '1.15'
             addGameVersion '1.15.1'
+            addGameVersion '1.15.2'
+            addGameVersion '1.15-Snapshot'
             addGameVersion 'Fabric'
             addGameVersion 'Java 8'
             relations {
                 requiredDependency 'fabric-api'
             }
             mainArtifact(file("${project.buildDir}/libs/${project.archivesBaseName}-${project.version}.jar")) {
-                displayName = "[Fabric ${project.minecraft_version}] ClothConfig2-$project.version"
+                displayName = "[Fabric 1.15.x] ClothConfig2-$project.version"
             }
             addArtifact(file("${project.buildDir}/libs/${project.archivesBaseName}-${project.version}-sources.jar"))
             afterEvaluate {

+ 1 - 1
gradle.properties

@@ -2,6 +2,6 @@ minecraft_version=1.15.1
 yarn_mappings=1.15.1+build.37
 loader_version=0.7.4+build.177
 fabric_version=0.4.28+build.288-1.15
-mod_version=2.8.4
+mod_version=2.9
 modmenu_version=1.8.4+build.20
 nec_version=1.2.3+1.15.1

+ 2 - 2
src/main/java/me/shedaniel/clothconfig2/gui/ClothConfigTabButton.java

@@ -4,8 +4,8 @@ import net.minecraft.client.gui.widget.AbstractPressableButtonWidget;
 
 public class ClothConfigTabButton extends AbstractPressableButtonWidget {
     
-    private int index = -1;
-    private ClothConfigScreen screen;
+    private final int index;
+    private final ClothConfigScreen screen;
     
     public ClothConfigTabButton(ClothConfigScreen screen, int index, int int_1, int int_2, int int_3, int int_4, String string_1) {
         super(int_1, int_2, int_3, int_4, string_1);

+ 1 - 0
src/main/java/me/shedaniel/clothconfig2/gui/entries/BaseListEntry.java

@@ -63,6 +63,7 @@ public abstract class BaseListEntry<T, C extends BaseListCell, SELF extends Base
         this(fieldName, tooltipSupplier, defaultValue, createNewInstance, saveConsumer, resetButtonKey, requiresRestart, true, true);
     }
 
+    @Deprecated
     public BaseListEntry(@NotNull String fieldName, @Nullable Supplier<Optional<String[]>> tooltipSupplier, @NotNull Supplier<List<T>> defaultValue, @NotNull Function<SELF, C> createNewInstance, @Nullable Consumer<List<T>> saveConsumer, String resetButtonKey, boolean requiresRestart, boolean deleteButtonEnabled, boolean insertInFront) {
         super(fieldName, tooltipSupplier, requiresRestart);
         this.deleteButtonEnabled = deleteButtonEnabled;

+ 2 - 3
src/main/java/me/shedaniel/clothconfig2/gui/entries/BooleanListEntry.java

@@ -73,7 +73,7 @@ public class BooleanListEntry extends TooltipListEntry<Boolean> {
     public void render(int index, int y, int x, int entryWidth, int entryHeight, int mouseX, int mouseY, boolean isSelected, float delta) {
         super.render(index, y, x, entryWidth, entryHeight, mouseX, mouseY, isSelected, delta);
         Window window = MinecraftClient.getInstance().getWindow();
-        this.resetButton.active = isEditable() && getDefaultValue().isPresent() && defaultValue.get().booleanValue() != bool.get();
+        this.resetButton.active = isEditable() && getDefaultValue().isPresent() && defaultValue.get() != bool.get();
         this.resetButton.y = y;
         this.buttonWidget.active = isEditable();
         this.buttonWidget.y = y;
@@ -82,13 +82,12 @@ public class BooleanListEntry extends TooltipListEntry<Boolean> {
             MinecraftClient.getInstance().textRenderer.drawWithShadow(I18n.translate(getFieldName()), window.getScaledWidth() - x - MinecraftClient.getInstance().textRenderer.getStringWidth(I18n.translate(getFieldName())), y + 5, 16777215);
             this.resetButton.x = x;
             this.buttonWidget.x = x + resetButton.getWidth() + 2;
-            this.buttonWidget.setWidth(150 - resetButton.getWidth() - 2);
         } else {
             MinecraftClient.getInstance().textRenderer.drawWithShadow(I18n.translate(getFieldName()), x, y + 5, getPreferredTextColor());
             this.resetButton.x = x + entryWidth - resetButton.getWidth();
             this.buttonWidget.x = x + entryWidth - 150;
-            this.buttonWidget.setWidth(150 - resetButton.getWidth() - 2);
         }
+        this.buttonWidget.setWidth(150 - resetButton.getWidth() - 2);
         resetButton.render(mouseX, mouseY, delta);
         buttonWidget.render(mouseX, mouseY, delta);
     }

+ 3 - 3
src/main/java/me/shedaniel/clothconfig2/gui/entries/DoubleListEntry.java

@@ -58,7 +58,7 @@ public class DoubleListEntry extends TextFieldListEntry<Double> {
     @Override
     protected void textFieldPreRender(TextFieldWidget widget) {
         try {
-            double i = Double.valueOf(textFieldWidget.getText());
+            double i = Double.parseDouble(textFieldWidget.getText());
             if (i < minimum || i > maximum)
                 widget.setEditableColor(16733525);
             else
@@ -70,7 +70,7 @@ public class DoubleListEntry extends TextFieldListEntry<Double> {
     
     @Override
     protected boolean isMatchDefault(String text) {
-        return getDefaultValue().isPresent() ? text.equals(defaultValue.get().toString()) : false;
+        return getDefaultValue().isPresent() && text.equals(defaultValue.get().toString());
     }
     
     @Override
@@ -101,7 +101,7 @@ public class DoubleListEntry extends TextFieldListEntry<Double> {
     @Override
     public Optional<String> getError() {
         try {
-            double i = Double.valueOf(textFieldWidget.getText());
+            double i = Double.parseDouble(textFieldWidget.getText());
             if (i > maximum)
                 return Optional.of(I18n.translate("text.cloth-config.error.too_large", maximum));
             else if (i < minimum)

+ 2 - 2
src/main/java/me/shedaniel/clothconfig2/gui/entries/DropdownBoxEntry.java

@@ -391,7 +391,7 @@ public class DropdownBoxEntry<T> extends TooltipListEntry<T> {
             if (currentElements.isEmpty()) {
                 TextRenderer textRenderer = MinecraftClient.getInstance().textRenderer;
                 String s = I18n.translate("text.cloth-config.dropdown.value.unknown");
-                textRenderer.drawWithShadow(s, lastRectangle.x + getCellCreator().getCellWidth() / 2 - textRenderer.getStringWidth(s) / 2, lastRectangle.y + lastRectangle.height + 3, -1);
+                textRenderer.drawWithShadow(s, lastRectangle.x + getCellCreator().getCellWidth() / 2f - textRenderer.getStringWidth(s) / 2f, lastRectangle.y + lastRectangle.height + 3, -1);
             }
 
             if (getMaxScrollPosition() > 6) {
@@ -451,7 +451,7 @@ public class DropdownBoxEntry<T> extends TooltipListEntry<T> {
                 } else if (double_2 > (double) lastRectangle.y + lastRectangle.height + getHeight()) {
                     scrollTo(getMaxScrollPosition(), false);
                 } else {
-                    double double_5 = (double) Math.max(1, this.getMaxScrollPosition());
+                    double double_5 = Math.max(1, this.getMaxScrollPosition());
                     int int_2 = getHeight();
                     int int_3 = MathHelper.clamp((int) ((float) (int_2 * int_2) / (float) this.getMaxScrollPosition()), 32, int_2 - 8);
                     double double_6 = Math.max(1.0D, double_5 / (double) (int_2 - int_3));

+ 4 - 4
src/main/java/me/shedaniel/clothconfig2/gui/entries/EnumListEntry.java

@@ -18,22 +18,22 @@ public class EnumListEntry<T extends Enum<?>> extends SelectionListEntry<T> {
     
     @Deprecated
     public EnumListEntry(String fieldName, Class<T> clazz, T value, String resetButtonKey, Supplier<T> defaultValue, Consumer<T> saveConsumer) {
-        super(fieldName, clazz.getEnumConstants(), value, resetButtonKey, defaultValue, saveConsumer, v -> DEFAULT_NAME_PROVIDER.apply(v));
+        super(fieldName, clazz.getEnumConstants(), value, resetButtonKey, defaultValue, saveConsumer, DEFAULT_NAME_PROVIDER::apply);
     }
     
     @Deprecated
     public EnumListEntry(String fieldName, Class<T> clazz, T value, String resetButtonKey, Supplier<T> defaultValue, Consumer<T> saveConsumer, Function<Enum, String> enumNameProvider) {
-        super(fieldName, clazz.getEnumConstants(), value, resetButtonKey, defaultValue, saveConsumer, v -> enumNameProvider.apply(v), null);
+        super(fieldName, clazz.getEnumConstants(), value, resetButtonKey, defaultValue, saveConsumer, enumNameProvider::apply, null);
     }
     
     @Deprecated
     public EnumListEntry(String fieldName, Class<T> clazz, T value, String resetButtonKey, Supplier<T> defaultValue, Consumer<T> saveConsumer, Function<Enum, String> enumNameProvider, Supplier<Optional<String[]>> tooltipSupplier) {
-        super(fieldName, clazz.getEnumConstants(), value, resetButtonKey, defaultValue, saveConsumer, v -> enumNameProvider.apply(v), tooltipSupplier, false);
+        super(fieldName, clazz.getEnumConstants(), value, resetButtonKey, defaultValue, saveConsumer, enumNameProvider::apply, tooltipSupplier, false);
     }
     
     @Deprecated
     public EnumListEntry(String fieldName, Class<T> clazz, T value, String resetButtonKey, Supplier<T> defaultValue, Consumer<T> saveConsumer, Function<Enum, String> enumNameProvider, Supplier<Optional<String[]>> tooltipSupplier, boolean requiresRestart) {
-        super(fieldName, clazz.getEnumConstants(), value, resetButtonKey, defaultValue, saveConsumer, v -> enumNameProvider.apply(v), tooltipSupplier, requiresRestart);
+        super(fieldName, clazz.getEnumConstants(), value, resetButtonKey, defaultValue, saveConsumer, enumNameProvider::apply, tooltipSupplier, requiresRestart);
     }
     
 }

+ 7 - 7
src/main/java/me/shedaniel/clothconfig2/gui/entries/FloatListEntry.java

@@ -14,10 +14,10 @@ public class FloatListEntry extends TextFieldListEntry<Float> {
         StringBuilder stringBuilder_1 = new StringBuilder();
         char[] var2 = s.toCharArray();
         int var3 = var2.length;
-        
-        for(int var4 = 0; var4 < var3; ++var4)
-            if (Character.isDigit(var2[var4]) || var2[var4] == '-' || var2[var4] == '.')
-                stringBuilder_1.append(var2[var4]);
+    
+        for (char c : var2)
+            if (Character.isDigit(c) || c == '-' || c == '.')
+                stringBuilder_1.append(c);
         
         return stringBuilder_1.toString();
     };
@@ -57,7 +57,7 @@ public class FloatListEntry extends TextFieldListEntry<Float> {
     @Override
     protected void textFieldPreRender(TextFieldWidget widget) {
         try {
-            double i = Float.valueOf(textFieldWidget.getText());
+            double i = Float.parseFloat(textFieldWidget.getText());
             if (i < minimum || i > maximum)
                 widget.setEditableColor(16733525);
             else
@@ -69,7 +69,7 @@ public class FloatListEntry extends TextFieldListEntry<Float> {
     
     @Override
     protected boolean isMatchDefault(String text) {
-        return getDefaultValue().isPresent() ? text.equals(defaultValue.get().toString()) : false;
+        return getDefaultValue().isPresent() && text.equals(defaultValue.get().toString());
     }
     
     public FloatListEntry setMinimum(float minimum) {
@@ -100,7 +100,7 @@ public class FloatListEntry extends TextFieldListEntry<Float> {
     @Override
     public Optional<String> getError() {
         try {
-            float i = Float.valueOf(textFieldWidget.getText());
+            float i = Float.parseFloat(textFieldWidget.getText());
             if (i > maximum)
                 return Optional.of(I18n.translate("text.cloth-config.error.too_large", maximum));
             else if (i < minimum)

+ 7 - 7
src/main/java/me/shedaniel/clothconfig2/gui/entries/IntegerListEntry.java

@@ -14,10 +14,10 @@ public class IntegerListEntry extends TextFieldListEntry<Integer> {
         StringBuilder stringBuilder_1 = new StringBuilder();
         char[] var2 = s.toCharArray();
         int var3 = var2.length;
-        
-        for(int var4 = 0; var4 < var3; ++var4)
-            if (Character.isDigit(var2[var4]) || var2[var4] == '-')
-                stringBuilder_1.append(var2[var4]);
+    
+        for (char c : var2)
+            if (Character.isDigit(c) || c == '-')
+                stringBuilder_1.append(c);
         
         return stringBuilder_1.toString();
     };
@@ -58,7 +58,7 @@ public class IntegerListEntry extends TextFieldListEntry<Integer> {
     @Override
     protected void textFieldPreRender(TextFieldWidget widget) {
         try {
-            double i = Integer.valueOf(textFieldWidget.getText());
+            double i = Integer.parseInt(textFieldWidget.getText());
             if (i < minimum || i > maximum)
                 widget.setEditableColor(16733525);
             else
@@ -70,7 +70,7 @@ public class IntegerListEntry extends TextFieldListEntry<Integer> {
     
     @Override
     protected boolean isMatchDefault(String text) {
-        return getDefaultValue().isPresent() ? text.equals(defaultValue.get().toString()) : false;
+        return getDefaultValue().isPresent() && text.equals(defaultValue.get().toString());
     }
     
     @Override
@@ -101,7 +101,7 @@ public class IntegerListEntry extends TextFieldListEntry<Integer> {
     @Override
     public Optional<String> getError() {
         try {
-            int i = Integer.valueOf(textFieldWidget.getText());
+            int i = Integer.parseInt(textFieldWidget.getText());
             if (i > maximum)
                 return Optional.of(I18n.translate("text.cloth-config.error.too_large", maximum));
             else if (i < minimum)

+ 1 - 2
src/main/java/me/shedaniel/clothconfig2/gui/entries/IntegerSliderEntry.java

@@ -114,13 +114,12 @@ public class IntegerSliderEntry extends TooltipListEntry<Integer> {
             MinecraftClient.getInstance().textRenderer.drawWithShadow(I18n.translate(getFieldName()), window.getScaledWidth() - x - MinecraftClient.getInstance().textRenderer.getStringWidth(I18n.translate(getFieldName())), y + 5, getPreferredTextColor());
             this.resetButton.x = x;
             this.sliderWidget.x = x + resetButton.getWidth() + 1;
-            this.sliderWidget.setWidth(150 - resetButton.getWidth() - 2);
         } else {
             MinecraftClient.getInstance().textRenderer.drawWithShadow(I18n.translate(getFieldName()), x, y + 5, getPreferredTextColor());
             this.resetButton.x = x + entryWidth - resetButton.getWidth();
             this.sliderWidget.x = x + entryWidth - 150;
-            this.sliderWidget.setWidth(150 - resetButton.getWidth() - 2);
         }
+        this.sliderWidget.setWidth(150 - resetButton.getWidth() - 2);
         resetButton.render(mouseX, mouseY, delta);
         sliderWidget.render(mouseX, mouseY, delta);
     }

+ 7 - 7
src/main/java/me/shedaniel/clothconfig2/gui/entries/LongListEntry.java

@@ -14,10 +14,10 @@ public class LongListEntry extends TextFieldListEntry<Long> {
         StringBuilder stringBuilder_1 = new StringBuilder();
         char[] var2 = s.toCharArray();
         int var3 = var2.length;
-        
-        for(int var4 = 0; var4 < var3; ++var4)
-            if (Character.isDigit(var2[var4]) || var2[var4] == '-')
-                stringBuilder_1.append(var2[var4]);
+    
+        for (char c : var2)
+            if (Character.isDigit(c) || c == '-')
+                stringBuilder_1.append(c);
         
         return stringBuilder_1.toString();
     };
@@ -57,7 +57,7 @@ public class LongListEntry extends TextFieldListEntry<Long> {
     @Override
     protected void textFieldPreRender(TextFieldWidget widget) {
         try {
-            double i = Long.valueOf(textFieldWidget.getText());
+            double i = Long.parseLong(textFieldWidget.getText());
             if (i < minimum || i > maximum)
                 widget.setEditableColor(16733525);
             else
@@ -75,7 +75,7 @@ public class LongListEntry extends TextFieldListEntry<Long> {
     
     @Override
     protected boolean isMatchDefault(String text) {
-        return getDefaultValue().isPresent() ? text.equals(defaultValue.get().toString()) : false;
+        return getDefaultValue().isPresent() && text.equals(defaultValue.get().toString());
     }
     
     public LongListEntry setMinimum(long minimum) {
@@ -100,7 +100,7 @@ public class LongListEntry extends TextFieldListEntry<Long> {
     @Override
     public Optional<String> getError() {
         try {
-            long i = Long.valueOf(textFieldWidget.getText());
+            long i = Long.parseLong(textFieldWidget.getText());
             if (i > maximum)
                 return Optional.of(I18n.translate("text.cloth-config.error.too_large", maximum));
             else if (i < minimum)

+ 2 - 3
src/main/java/me/shedaniel/clothconfig2/gui/entries/LongSliderEntry.java

@@ -111,7 +111,7 @@ public class LongSliderEntry extends TooltipListEntry<Long> {
     public void render(int index, int y, int x, int entryWidth, int entryHeight, int mouseX, int mouseY, boolean isSelected, float delta) {
         super.render(index, y, x, entryWidth, entryHeight, mouseX, mouseY, isSelected, delta);
         Window window = MinecraftClient.getInstance().getWindow();
-        this.resetButton.active = isEditable() && getDefaultValue().isPresent() && defaultValue.get().longValue() != value.get();
+        this.resetButton.active = isEditable() && getDefaultValue().isPresent() && defaultValue.get() != value.get();
         this.resetButton.y = y;
         this.sliderWidget.active = isEditable();
         this.sliderWidget.y = y;
@@ -119,13 +119,12 @@ public class LongSliderEntry extends TooltipListEntry<Long> {
             MinecraftClient.getInstance().textRenderer.drawWithShadow(I18n.translate(getFieldName()), window.getScaledWidth() - x - MinecraftClient.getInstance().textRenderer.getStringWidth(I18n.translate(getFieldName())), y + 5, getPreferredTextColor());
             this.resetButton.x = x;
             this.sliderWidget.x = x + resetButton.getWidth() + 1;
-            this.sliderWidget.setWidth(150 - resetButton.getWidth() - 2);
         } else {
             MinecraftClient.getInstance().textRenderer.drawWithShadow(I18n.translate(getFieldName()), x, y + 5, getPreferredTextColor());
             this.resetButton.x = x + entryWidth - resetButton.getWidth();
             this.sliderWidget.x = x + entryWidth - 150;
-            this.sliderWidget.setWidth(150 - resetButton.getWidth() - 2);
         }
+        this.sliderWidget.setWidth(150 - resetButton.getWidth() - 2);
         resetButton.render(mouseX, mouseY, delta);
         sliderWidget.render(mouseX, mouseY, delta);
     }

+ 1 - 1
src/main/java/me/shedaniel/clothconfig2/gui/entries/MultiElementListEntry.java

@@ -41,7 +41,7 @@ public class MultiElementListEntry<T> extends TooltipListEntry<T> {
 
     @Override
     public boolean isRequiresRestart() {
-        for (AbstractConfigListEntry entry : entries)
+        for (AbstractConfigListEntry<?> entry : entries)
             if (entry.isRequiresRestart())
                 return true;
         return false;

+ 4 - 3
src/main/java/me/shedaniel/clothconfig2/gui/entries/SelectionListEntry.java

@@ -7,6 +7,7 @@ import net.minecraft.client.gui.Element;
 import net.minecraft.client.gui.widget.ButtonWidget;
 import net.minecraft.client.resource.language.I18n;
 import net.minecraft.client.util.Window;
+import org.jetbrains.annotations.ApiStatus;
 import org.jetbrains.annotations.NotNull;
 
 import java.util.List;
@@ -16,6 +17,7 @@ import java.util.function.Consumer;
 import java.util.function.Function;
 import java.util.function.Supplier;
 
+@ApiStatus.Internal
 public class SelectionListEntry<T> extends TooltipListEntry<T> {
     
     private ImmutableList<T> values;
@@ -99,13 +101,12 @@ public class SelectionListEntry<T> extends TooltipListEntry<T> {
             MinecraftClient.getInstance().textRenderer.drawWithShadow(I18n.translate(getFieldName()), window.getScaledWidth() - x - MinecraftClient.getInstance().textRenderer.getStringWidth(I18n.translate(getFieldName())), y + 5, getPreferredTextColor());
             this.resetButton.x = x;
             this.buttonWidget.x = x + resetButton.getWidth() + 2;
-            this.buttonWidget.setWidth(150 - resetButton.getWidth() - 2);
         } else {
             MinecraftClient.getInstance().textRenderer.drawWithShadow(I18n.translate(getFieldName()), x, y + 5, getPreferredTextColor());
             this.resetButton.x = x + entryWidth - resetButton.getWidth();
             this.buttonWidget.x = x + entryWidth - 150;
-            this.buttonWidget.setWidth(150 - resetButton.getWidth() - 2);
         }
+        this.buttonWidget.setWidth(150 - resetButton.getWidth() - 2);
         resetButton.render(mouseX, mouseY, delta);
         buttonWidget.render(mouseX, mouseY, delta);
     }
@@ -119,7 +120,7 @@ public class SelectionListEntry<T> extends TooltipListEntry<T> {
         return widgets;
     }
     
-    public static interface Translatable {
+    public interface Translatable {
         @NotNull
         String getKey();
     }

+ 1 - 1
src/main/java/me/shedaniel/clothconfig2/gui/entries/StringListEntry.java

@@ -43,7 +43,7 @@ public class StringListEntry extends TextFieldListEntry<String> {
     
     @Override
     protected boolean isMatchDefault(String text) {
-        return getDefaultValue().isPresent() ? text.equals(getDefaultValue().get()) : false;
+        return getDefaultValue().isPresent() && text.equals(getDefaultValue().get());
     }
     
 }

+ 5 - 5
src/main/java/me/shedaniel/clothconfig2/gui/entries/SubCategoryListEntry.java

@@ -74,13 +74,13 @@ public class SubCategoryListEntry extends TooltipListEntry<List<AbstractConfigLi
         RenderSystem.color4f(1, 1, 1, 1);
         blit(x - 15, y + 4, 24, (widget.rectangle.contains(mouseX, mouseY) ? 18 : 0) + (expanded ? 9 : 0), 9, 9);
         MinecraftClient.getInstance().textRenderer.drawWithShadow(I18n.translate(categoryName), x, y + 5, widget.rectangle.contains(mouseX, mouseY) ? 0xffe6fe16 : -1);
-        for(AbstractConfigListEntry entry : entries) {
+        for(AbstractConfigListEntry<?> entry : entries) {
             entry.setParent(getParent());
             entry.setScreen(getScreen());
         }
         if (expanded) {
             int yy = y + 24;
-            for (AbstractConfigListEntry entry : entries) {
+            for (AbstractConfigListEntry<?> entry : entries) {
                 entry.render(-1, yy, x + 14, entryWidth - 14, entry.getItemHeight(), mouseX, mouseY, isSelected, delta);
                 yy += entry.getItemHeight();
             }
@@ -100,7 +100,7 @@ public class SubCategoryListEntry extends TooltipListEntry<List<AbstractConfigLi
     public int getItemHeight() {
         if (expanded) {
             int i = 24;
-            for (AbstractConfigListEntry entry : entries)
+            for (AbstractConfigListEntry<?> entry : entries)
                 i += entry.getItemHeight();
             return i;
         }
@@ -120,11 +120,11 @@ public class SubCategoryListEntry extends TooltipListEntry<List<AbstractConfigLi
     @Override
     public Optional<String> getError() {
         String error = null;
-        for(AbstractConfigListEntry entry : entries)
+        for(AbstractConfigListEntry<?> entry : entries)
             if (entry.getError().isPresent()) {
                 if (error != null)
                     return Optional.ofNullable(I18n.translate("text.cloth-config.multi_error"));
-                return Optional.ofNullable((String) entry.getError().get());
+                return entry.getError();
             }
         return Optional.ofNullable(error);
     }

+ 1 - 2
src/main/java/me/shedaniel/clothconfig2/gui/entries/TextFieldListEntry.java

@@ -89,13 +89,12 @@ public abstract class TextFieldListEntry<T> extends TooltipListEntry<T> {
             MinecraftClient.getInstance().textRenderer.drawWithShadow(I18n.translate(getFieldName()), window.getScaledWidth() - x - MinecraftClient.getInstance().textRenderer.getStringWidth(I18n.translate(getFieldName())), y + 5, getPreferredTextColor());
             this.resetButton.x = x;
             this.textFieldWidget.x = x + resetButton.getWidth();
-            setTextFieldWidth(textFieldWidget, 148 - resetButton.getWidth() - 4);
         } else {
             MinecraftClient.getInstance().textRenderer.drawWithShadow(I18n.translate(getFieldName()), x, y + 5, getPreferredTextColor());
             this.resetButton.x = x + entryWidth - resetButton.getWidth();
             this.textFieldWidget.x = x + entryWidth - 148;
-            setTextFieldWidth(textFieldWidget, 148 - resetButton.getWidth() - 4);
         }
+        setTextFieldWidth(textFieldWidget, 148 - resetButton.getWidth() - 4);
         resetButton.render(mouseX, mouseY, delta);
         textFieldWidget.render(mouseX, mouseY, delta);
     }

+ 3 - 3
src/main/java/me/shedaniel/clothconfig2/gui/entries/TextListEntry.java

@@ -8,7 +8,7 @@ import java.util.List;
 import java.util.Optional;
 import java.util.function.Supplier;
 
-public class TextListEntry extends TooltipListEntry {
+public class TextListEntry extends TooltipListEntry<Object> {
     
     private int savedWidth = -1;
     private int color;
@@ -37,8 +37,8 @@ public class TextListEntry extends TooltipListEntry {
         this.savedWidth = entryWidth;
         int yy = y + 4;
         List<String> strings = MinecraftClient.getInstance().textRenderer.wrapStringToWidthAsList(text, savedWidth);
-        for(int i = 0; i < strings.size(); i++) {
-            MinecraftClient.getInstance().textRenderer.drawWithShadow(strings.get(i), x, yy, color);
+        for (String string : strings) {
+            MinecraftClient.getInstance().textRenderer.drawWithShadow(string, x, yy, color);
             yy += MinecraftClient.getInstance().textRenderer.fontHeight + 3;
         }
     }

+ 35 - 36
src/main/java/me/shedaniel/clothconfig2/gui/widget/DynamicEntryListWidget.java

@@ -23,7 +23,6 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Objects;
 
-@SuppressWarnings("deprecation")
 @Environment(EnvType.CLIENT)
 public abstract class DynamicEntryListWidget<E extends DynamicEntryListWidget.Entry<E>> extends AbstractParentElement implements Drawable {
     protected static final int DRAG_OUTSIDE = -2;
@@ -92,7 +91,7 @@ public abstract class DynamicEntryListWidget<E extends DynamicEntryListWidget.En
     }
     
     protected E getItem(int index) {
-        return (E) this.children().get(index);
+        return this.children().get(index);
     }
     
     protected int addItem(E item) {
@@ -123,7 +122,7 @@ public abstract class DynamicEntryListWidget<E extends DynamicEntryListWidget.En
                 break;
             }
         }
-        return mouseX < (double) this.getScrollbarPosition() && mouseX >= minX && mouseX <= maxX && itemIndex >= 0 && currentY >= 0 && itemIndex < this.getItemCount() ? (E) this.children().get(itemIndex) : null;
+        return mouseX < (double) this.getScrollbarPosition() && mouseX >= minX && mouseX <= maxX && itemIndex >= 0 && currentY >= 0 && itemIndex < this.getItemCount() ? this.children().get(itemIndex) : null;
     }
     
     public void updateSize(int width, int height, int top, int bottom) {
@@ -150,7 +149,7 @@ public abstract class DynamicEntryListWidget<E extends DynamicEntryListWidget.En
             }
         }
         list.add(i);
-        return list.stream().max((a, b) -> Integer.compare(a, b)).orElse(0);
+        return list.stream().max(Integer::compare).orElse(0);
     }
     
     protected void clickedHeader(int int_1, int int_2) {
@@ -178,6 +177,7 @@ public abstract class DynamicEntryListWidget<E extends DynamicEntryListWidget.En
         tessellator.draw();
     }
     
+    @SuppressWarnings("deprecation")
     public void render(int mouseX, int mouseY, float delta) {
         this.drawBackground();
         int scrollbarPosition = this.getScrollbarPosition();
@@ -224,9 +224,10 @@ public abstract class DynamicEntryListWidget<E extends DynamicEntryListWidget.En
         RenderSystem.disableBlend();
     }
     
+    @SuppressWarnings("deprecation")
     protected void renderScrollBar(Tessellator tessellator, BufferBuilder buffer, int maxScroll, int scrollbarPositionMinX, int scrollbarPositionMaxX) {
         if (maxScroll > 0) {
-            int int_9 = (int) (((this.bottom - this.top) * (this.bottom - this.top)) / this.getMaxScrollPosition());
+            int int_9 = ((this.bottom - this.top) * (this.bottom - this.top)) / this.getMaxScrollPosition();
             int_9 = MathHelper.clamp(int_9, 32, this.bottom - this.top - 8);
             int int_10 = (int) this.getScroll() * (this.bottom - this.top - int_9) / maxScroll + this.top;
             if (int_10 < this.top) {
@@ -255,7 +256,7 @@ public abstract class DynamicEntryListWidget<E extends DynamicEntryListWidget.En
     }
     
     protected void centerScrollOn(E item) {
-        double d = (this.bottom - this.top) / -2;
+        double d = (this.bottom - this.top) / -2d;
         for(int i = 0; i < this.children().indexOf(item) && i < this.getItemCount(); i++)
             d += getItem(i).getItemHeight();
         this.capYPosition(d);
@@ -281,7 +282,7 @@ public abstract class DynamicEntryListWidget<E extends DynamicEntryListWidget.En
     }
     
     public void capYPosition(double double_1) {
-        this.scroll = MathHelper.clamp(double_1, 0.0D, (double) this.getMaxScroll());
+        this.scroll = MathHelper.clamp(double_1, 0.0D, this.getMaxScroll());
     }
     
     protected int getMaxScroll() {
@@ -336,9 +337,9 @@ public abstract class DynamicEntryListWidget<E extends DynamicEntryListWidget.En
             if (double_2 < (double) this.top) {
                 this.capYPosition(0.0D);
             } else if (double_2 > (double) this.bottom) {
-                this.capYPosition((double) this.getMaxScroll());
+                this.capYPosition(this.getMaxScroll());
             } else {
-                double double_5 = (double) Math.max(1, this.getMaxScroll());
+                double double_5 = Math.max(1, this.getMaxScroll());
                 int int_2 = this.bottom - this.top;
                 int int_3 = MathHelper.clamp((int) ((float) (int_2 * int_2) / (float) this.getMaxScrollPosition()), 32, int_2 - 8);
                 double double_6 = Math.max(1.0D, double_5 / (double) (int_2 - int_3));
@@ -379,7 +380,7 @@ public abstract class DynamicEntryListWidget<E extends DynamicEntryListWidget.En
         if (!this.children().isEmpty()) {
             int int_2 = this.children().indexOf(this.getSelectedItem());
             int int_3 = MathHelper.clamp(int_2 + int_1, 0, this.getItemCount() - 1);
-            E itemListWidget$Item_1 = (E) this.children().get(int_3);
+            E itemListWidget$Item_1 = this.children().get(int_3);
             this.selectItem(itemListWidget$Item_1);
             this.ensureVisible(itemListWidget$Item_1);
         }
@@ -410,17 +411,17 @@ public abstract class DynamicEntryListWidget<E extends DynamicEntryListWidget.En
                 float float_2 = this.isFocused() ? 1.0F : 0.5F;
                 RenderSystem.color4f(float_2, float_2, float_2, 1.0F);
                 buffer.begin(7, VertexFormats.POSITION);
-                buffer.vertex((double) itemMinX, (double) (itemY + itemHeight + 2), 0.0D).next();
-                buffer.vertex((double) itemMaxX, (double) (itemY + itemHeight + 2), 0.0D).next();
-                buffer.vertex((double) itemMaxX, (double) (itemY - 2), 0.0D).next();
-                buffer.vertex((double) itemMinX, (double) (itemY - 2), 0.0D).next();
+                buffer.vertex(itemMinX, itemY + itemHeight + 2, 0.0D).next();
+                buffer.vertex(itemMaxX, itemY + itemHeight + 2, 0.0D).next();
+                buffer.vertex(itemMaxX, itemY - 2, 0.0D).next();
+                buffer.vertex(itemMinX, itemY - 2, 0.0D).next();
                 tessellator.draw();
                 RenderSystem.color4f(0.0F, 0.0F, 0.0F, 1.0F);
                 buffer.begin(7, VertexFormats.POSITION);
-                buffer.vertex((double) (itemMinX + 1), (double) (itemY + itemHeight + 1), 0.0D).next();
-                buffer.vertex((double) (itemMaxX - 1), (double) (itemY + itemHeight + 1), 0.0D).next();
-                buffer.vertex((double) (itemMaxX - 1), (double) (itemY - 1), 0.0D).next();
-                buffer.vertex((double) (itemMinX + 1), (double) (itemY - 1), 0.0D).next();
+                buffer.vertex(itemMinX + 1, itemY + itemHeight + 1, 0.0D).next();
+                buffer.vertex(itemMaxX - 1, itemY + itemHeight + 1, 0.0D).next();
+                buffer.vertex(itemMaxX - 1, itemY - 1, 0.0D).next();
+                buffer.vertex(itemMinX + 1, itemY - 1, 0.0D).next();
                 tessellator.draw();
                 RenderSystem.enableTexture();
             }
@@ -428,7 +429,7 @@ public abstract class DynamicEntryListWidget<E extends DynamicEntryListWidget.En
             int y = this.getRowTop(renderIndex);
             int x = this.getRowLeft();
             DiffuseLighting.disable();
-            item.render(renderIndex, y, x, itemWidth, itemHeight, int_3, int_4, this.isMouseOver((double) int_3, (double) int_4) && Objects.equals(this.getItemAtPosition((double) int_3, (double) int_4), item), float_1);
+            item.render(renderIndex, y, x, itemWidth, itemHeight, int_3, int_4, this.isMouseOver(int_3, int_4) && Objects.equals(this.getItemAtPosition(int_3, int_4), item), float_1);
         }
         
     }
@@ -448,29 +449,30 @@ public abstract class DynamicEntryListWidget<E extends DynamicEntryListWidget.En
         return false;
     }
     
+    @SuppressWarnings("deprecation")
     protected void renderHoleBackground(int int_1, int int_2, int int_3, int int_4) {
-        Tessellator tessellator_1 = Tessellator.getInstance();
-        BufferBuilder bufferBuilder_1 = tessellator_1.getBuffer();
+        Tessellator tessellator = Tessellator.getInstance();
+        BufferBuilder buffer = tessellator.getBuffer();
         this.client.getTextureManager().bindTexture(backgroundLocation);
         RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
         float float_1 = 32.0F;
-        bufferBuilder_1.begin(7, VertexFormats.POSITION_TEXTURE_COLOR);
-        bufferBuilder_1.vertex((double) this.left, (double) int_2, 0.0D).texture(0, ((float) int_2 / 32.0F)).color(64, 64, 64, int_4).next();
-        bufferBuilder_1.vertex((double) (this.left + this.width), (double) int_2, 0.0D).texture(((float) this.width / 32.0F), ((float) int_2 / 32.0F)).color(64, 64, 64, int_4).next();
-        bufferBuilder_1.vertex((double) (this.left + this.width), (double) int_1, 0.0D).texture(((float) this.width / 32.0F), ((float) int_1 / 32.0F)).color(64, 64, 64, int_3).next();
-        bufferBuilder_1.vertex((double) this.left, (double) int_1, 0.0D).texture(0, ((float) int_1 / 32.0F)).color(64, 64, 64, int_3).next();
-        tessellator_1.draw();
+        buffer.begin(7, VertexFormats.POSITION_TEXTURE_COLOR);
+        buffer.vertex(this.left, int_2, 0.0D).texture(0, ((float) int_2 / 32.0F)).color(64, 64, 64, int_4).next();
+        buffer.vertex(this.left + this.width, int_2, 0.0D).texture(((float) this.width / 32.0F), ((float) int_2 / 32.0F)).color(64, 64, 64, int_4).next();
+        buffer.vertex(this.left + this.width, int_1, 0.0D).texture(((float) this.width / 32.0F), ((float) int_1 / 32.0F)).color(64, 64, 64, int_3).next();
+        buffer.vertex(this.left, int_1, 0.0D).texture(0, ((float) int_1 / 32.0F)).color(64, 64, 64, int_3).next();
+        tessellator.draw();
     }
     
     protected E remove(int int_1) {
-        E itemListWidget$Item_1 = (E) this.entries.get(int_1);
-        return this.removeEntry((E) this.entries.get(int_1)) ? itemListWidget$Item_1 : null;
+        E itemListWidget$Item_1 = this.entries.get(int_1);
+        return this.removeEntry(this.entries.get(int_1)) ? itemListWidget$Item_1 : null;
     }
     
     protected boolean removeEntry(E itemListWidget$Item_1) {
         boolean boolean_1 = this.entries.remove(itemListWidget$Item_1);
         if (boolean_1 && itemListWidget$Item_1 == this.getSelectedItem()) {
-            this.selectItem((E) null);
+            this.selectItem(null);
         }
         
         return boolean_1;
@@ -482,7 +484,6 @@ public abstract class DynamicEntryListWidget<E extends DynamicEntryListWidget.En
         private SmoothScrollingSettings() {}
     }
     
-    @SuppressWarnings("deprecation")
     @Environment(EnvType.CLIENT)
     public abstract static class Entry<E extends Entry<E>> extends DrawableHelper implements Element {
         @Deprecated DynamicEntryListWidget<E> parent;
@@ -527,7 +528,7 @@ public abstract class DynamicEntryListWidget<E extends DynamicEntryListWidget.En
         
         @Override
         public E get(int int_1) {
-            return (E) this.items.get(int_1);
+            return this.items.get(int_1);
         }
         
         @Override
@@ -536,15 +537,13 @@ public abstract class DynamicEntryListWidget<E extends DynamicEntryListWidget.En
         }
         
         @Override
-        @SuppressWarnings("deprecation")
         public E set(int int_1, E itemListWidget$Item_1) {
-            E itemListWidget$Item_2 = (E) this.items.set(int_1, itemListWidget$Item_1);
+            E itemListWidget$Item_2 = this.items.set(int_1, itemListWidget$Item_1);
             itemListWidget$Item_1.parent = DynamicEntryListWidget.this;
             return itemListWidget$Item_2;
         }
         
         @Override
-        @SuppressWarnings("deprecation")
         public void add(int int_1, E itemListWidget$Item_1) {
             this.items.add(int_1, itemListWidget$Item_1);
             itemListWidget$Item_1.parent = DynamicEntryListWidget.this;
@@ -552,7 +551,7 @@ public abstract class DynamicEntryListWidget<E extends DynamicEntryListWidget.En
         
         @Override
         public E remove(int int_1) {
-            return (E) this.items.remove(int_1);
+            return this.items.remove(int_1);
         }
     }
 }

+ 6 - 6
src/main/java/me/shedaniel/clothconfig2/gui/widget/DynamicSmoothScrollingEntryListWidget.java

@@ -68,22 +68,22 @@ public abstract class DynamicSmoothScrollingEntryListWidget<E extends DynamicEnt
         if (smoothScrolling)
             this.scroll = double_1;
         else
-            this.scroll = MathHelper.clamp(double_1, 0.0D, (double) this.getMaxScroll());
+            this.scroll = MathHelper.clamp(double_1, 0.0D, this.getMaxScroll());
     }
     
     @Override
     public boolean mouseDragged(double double_1, double double_2, int int_1, double double_3, double double_4) {
         if (!smoothScrolling)
             return super.mouseDragged(double_1, double_2, int_1, double_3, double_4);
-        if (this.getFocused() != null && this.isDragging() && int_1 == 0 ? this.getFocused().mouseDragged(double_1, double_2, int_1, double_3, double_4) : false) {
+        if ((this.getFocused() != null && this.isDragging() && int_1 == 0) && this.getFocused().mouseDragged(double_1, double_2, int_1, double_3, double_4)) {
             return true;
         } else if (int_1 == 0 && this.scrolling) {
             if (double_2 < (double) this.top) {
                 this.capYPosition(0.0D);
             } else if (double_2 > (double) this.bottom) {
-                this.capYPosition((double) this.getMaxScroll());
+                this.capYPosition(this.getMaxScroll());
             } else {
-                double double_5 = (double) Math.max(1, this.getMaxScroll());
+                double double_5 = Math.max(1, this.getMaxScroll());
                 int int_2 = this.bottom - this.top;
                 int int_3 = MathHelper.clamp((int) ((float) (int_2 * int_2) / (float) this.getMaxScrollPosition()), 32, int_2 - 8);
                 double double_6 = Math.max(1.0D, double_5 / (double) (int_2 - int_3));
@@ -110,7 +110,7 @@ public abstract class DynamicSmoothScrollingEntryListWidget<E extends DynamicEnt
         if (!smoothScrolling) {
             this.scrollVelocity = 0d;
             scroll += 16 * -double_3;
-            this.scroll = MathHelper.clamp(double_1, 0.0D, (double) this.getMaxScroll());
+            this.scroll = MathHelper.clamp(double_1, 0.0D, this.getMaxScroll());
             return true;
         }
         if (scroll <= getMaxScroll() && double_3 < 0)
@@ -128,7 +128,7 @@ public abstract class DynamicSmoothScrollingEntryListWidget<E extends DynamicEnt
         if (!smoothScrolling)
             super.renderScrollBar(tessellator, buffer, maxScroll, scrollbarPositionMinX, scrollbarPositionMaxX);
         else if (maxScroll > 0) {
-            int height = (int) (((this.bottom - this.top) * (this.bottom - this.top)) / this.getMaxScrollPosition());
+            int height = ((this.bottom - this.top) * (this.bottom - this.top)) / this.getMaxScrollPosition();
             height = MathHelper.clamp(height, 32, this.bottom - this.top - 8);
             height -= Math.min((scroll < 0 ? (int) -scroll : scroll > getMaxScroll() ? (int) scroll - getMaxScroll() : 0), height * .75);
             int minY = Math.min(Math.max((int) this.getScroll() * (this.bottom - this.top - height) / maxScroll + this.top, this.top), this.bottom - height);

+ 1 - 3
src/main/java/me/shedaniel/clothconfig2/impl/ConfigBuilderImpl.java

@@ -134,8 +134,7 @@ public class ConfigBuilderImpl implements ConfigBuilder {
     public ConfigBuilder removeCategoryIfExists(String category) {
         if (dataMap.containsKey(category) && fallbackCategory.equals(category))
             fallbackCategory = null;
-        if (dataMap.containsKey(category))
-            dataMap.remove(category);
+        dataMap.remove(category);
         return this;
     }
     
@@ -210,7 +209,6 @@ public class ConfigBuilderImpl implements ConfigBuilder {
         return afterInitConsumer;
     }
     
-    @SuppressWarnings("deprecation")
     @Override
     public Screen build() {
         if (dataMap.isEmpty() || fallbackCategory == null)

+ 3 - 3
src/main/java/me/shedaniel/clothconfig2/impl/ConfigEntryBuilderImpl.java

@@ -100,12 +100,12 @@ public class ConfigEntryBuilderImpl implements ConfigEntryBuilder {
     
     @Override
     public <T extends Enum<?>> EnumSelectorBuilder<T> startEnumSelector(String fieldNameKey, Class<T> clazz, T value) {
-        return new EnumSelectorBuilder<T>(resetButtonKey, fieldNameKey, clazz, value);
+        return new EnumSelectorBuilder<>(resetButtonKey, fieldNameKey, clazz, value);
     }
     
     @Override
     public <T> SelectorBuilder<T> startSelector(String fieldNameKey, T[] valuesArray, T value) {
-        return new SelectorBuilder<T>(resetButtonKey, fieldNameKey, valuesArray, value);
+        return new SelectorBuilder<>(resetButtonKey, fieldNameKey, valuesArray, value);
     }
     
     @Override
@@ -145,7 +145,7 @@ public class ConfigEntryBuilderImpl implements ConfigEntryBuilder {
     
     @Override
     public <T> DropdownMenuBuilder<T> startDropdownMenu(String fieldNameKey, SelectionTopCellElement<T> topCellElement, SelectionCellCreator<T> cellCreator) {
-        return new DropdownMenuBuilder(resetButtonKey, fieldNameKey, topCellElement, cellCreator);
+        return new DropdownMenuBuilder<>(resetButtonKey, fieldNameKey, topCellElement, cellCreator);
     }
     
 }