Эх сурвалжийг харах

Replace JSR-305 annotations with Jetbrains annotations

Also update Gradle wrapper
Mitchell Skaggs 5 жил өмнө
parent
commit
dea40d7fc7
29 өөрчлөгдсөн 426 нэмэгдсэн , 373 устгасан
  1. 1 1
      build.gradle
  2. 1 1
      gradle/wrapper/gradle-wrapper.properties
  3. 4 3
      src/main/java/me/shedaniel/clothconfig2/gui/ClothConfigScreen.java
  4. 15 15
      src/main/java/me/shedaniel/clothconfig2/gui/entries/DoubleListListEntry.java
  5. 161 149
      src/main/java/me/shedaniel/clothconfig2/gui/entries/DropdownBoxEntry.java
  6. 2 2
      src/main/java/me/shedaniel/clothconfig2/gui/entries/SelectionListEntry.java
  7. 11 11
      src/main/java/me/shedaniel/clothconfig2/gui/entries/SubCategoryListEntry.java
  8. 7 6
      src/main/java/me/shedaniel/clothconfig2/gui/entries/TooltipListEntry.java
  9. 27 23
      src/main/java/me/shedaniel/clothconfig2/impl/builders/BooleanToggleBuilder.java
  10. 6 4
      src/main/java/me/shedaniel/clothconfig2/impl/builders/DoubleFieldBuilder.java
  11. 28 28
      src/main/java/me/shedaniel/clothconfig2/impl/builders/DoubleListBuilder.java
  12. 6 6
      src/main/java/me/shedaniel/clothconfig2/impl/builders/DropdownMenuBuilder.java
  13. 6 4
      src/main/java/me/shedaniel/clothconfig2/impl/builders/EnumSelectorBuilder.java
  14. 24 19
      src/main/java/me/shedaniel/clothconfig2/impl/builders/FieldBuilder.java
  15. 6 4
      src/main/java/me/shedaniel/clothconfig2/impl/builders/FloatFieldBuilder.java
  16. 5 5
      src/main/java/me/shedaniel/clothconfig2/impl/builders/FloatListBuilder.java
  17. 6 4
      src/main/java/me/shedaniel/clothconfig2/impl/builders/IntFieldBuilder.java
  18. 6 6
      src/main/java/me/shedaniel/clothconfig2/impl/builders/IntListBuilder.java
  19. 6 4
      src/main/java/me/shedaniel/clothconfig2/impl/builders/IntSliderBuilder.java
  20. 22 19
      src/main/java/me/shedaniel/clothconfig2/impl/builders/KeyCodeBuilder.java
  21. 6 4
      src/main/java/me/shedaniel/clothconfig2/impl/builders/LongFieldBuilder.java
  22. 12 12
      src/main/java/me/shedaniel/clothconfig2/impl/builders/LongListBuilder.java
  23. 7 5
      src/main/java/me/shedaniel/clothconfig2/impl/builders/LongSliderBuilder.java
  24. 6 4
      src/main/java/me/shedaniel/clothconfig2/impl/builders/SelectorBuilder.java
  25. 7 5
      src/main/java/me/shedaniel/clothconfig2/impl/builders/StringFieldBuilder.java
  26. 6 4
      src/main/java/me/shedaniel/clothconfig2/impl/builders/StringListBuilder.java
  27. 12 10
      src/main/java/me/shedaniel/clothconfig2/impl/builders/SubCategoryBuilder.java
  28. 13 10
      src/main/java/me/shedaniel/clothconfig2/impl/builders/TextDescriptionBuilder.java
  29. 7 5
      src/main/java/me/shedaniel/clothconfig2/impl/builders/TextFieldBuilder.java

+ 1 - 1
build.gradle

@@ -42,7 +42,7 @@ static def buildTime() {
 }
 
 dependencies {
-    compileOnly "com.google.code.findbugs:jsr305:3.0.2"
+    compileOnly 'org.jetbrains:annotations:18.0.0'
 
     minecraft "com.mojang:minecraft:${project.minecraft_version}"
     mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"

+ 1 - 1
gradle/wrapper/gradle-wrapper.properties

@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-6.1-all.zip

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

@@ -28,8 +28,8 @@ import net.minecraft.util.Identifier;
 import net.minecraft.util.Pair;
 import net.minecraft.util.Tickable;
 import net.minecraft.util.math.MathHelper;
+import org.jetbrains.annotations.Nullable;
 
-import javax.annotation.Nullable;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
@@ -65,9 +65,10 @@ public abstract class ClothConfigScreen extends Screen {
     private Map<String, Identifier> categoryBackgroundLocation;
     private boolean transparentBackground = false;
     private boolean editable = true;
-    @Nullable private String defaultFallbackCategory = null;
+    @Nullable
+    private String defaultFallbackCategory = null;
     private boolean alwaysShowTabs = false;
-    
+
     @Deprecated
     public ClothConfigScreen(Screen parent, String title, Map<String, List<Pair<String, Object>>> o, boolean confirmSave, boolean displayErrors, boolean smoothScrollingList, Identifier defaultBackgroundLocation, Map<String, Identifier> categoryBackgroundLocation) {
         super(new LiteralText(""));

+ 15 - 15
src/main/java/me/shedaniel/clothconfig2/gui/entries/DoubleListListEntry.java

@@ -33,15 +33,15 @@ public class DoubleListListEntry extends BaseListEntry<Double, DoubleListListEnt
         this.widgets.addAll(cells);
         expanded = defaultExpanded;
     }
-    
+
     public Function<Double, Optional<String>> getCellErrorSupplier() {
         return cellErrorSupplier;
     }
-    
+
     public void setCellErrorSupplier(Function<Double, Optional<String>> cellErrorSupplier) {
         this.cellErrorSupplier = cellErrorSupplier;
     }
-    
+
     @Override
     public List<Double> getValue() {
         return cells.stream().map(DoubleListCell::getValue).collect(Collectors.toList());
@@ -73,17 +73,17 @@ public class DoubleListListEntry extends BaseListEntry<Double, DoubleListListEnt
             StringBuilder stringBuilder_1 = new StringBuilder();
             char[] var2 = s.toCharArray();
             int var3 = var2.length;
-            
-            for(int var4 = 0; var4 < var3; ++var4)
+
+            for (int var4 = 0; var4 < var3; ++var4)
                 if (Character.isDigit(var2[var4]) || var2[var4] == '-' || var2[var4] == '.')
                     stringBuilder_1.append(var2[var4]);
-            
+
             return stringBuilder_1.toString();
         };
         private TextFieldWidget widget;
         private boolean isSelected;
         private DoubleListListEntry listListEntry;
-        
+
         public DoubleListCell(double value, DoubleListListEntry listListEntry) {
             this.listListEntry = listListEntry;
             this.setErrorSupplier(() -> listListEntry.cellErrorSupplier == null ? Optional.empty() : listListEntry.getCellErrorSupplier().apply(getValue()));
@@ -96,7 +96,7 @@ public class DoubleListListEntry extends BaseListEntry<Double, DoubleListListEnt
                     super.render(int_1, int_2, Double_1);
                     setFocused(f);
                 }
-                
+
                 @Override
                 public void write(String string_1) {
                     super.write(stripCharacters.apply(string_1));
@@ -110,7 +110,7 @@ public class DoubleListListEntry extends BaseListEntry<Double, DoubleListListEnt
                     listListEntry.getScreen().setEdited(true, listListEntry.isRequiresRestart());
             });
         }
-        
+
         public double getValue() {
             try {
                 return Double.valueOf(widget.getText());
@@ -118,7 +118,7 @@ public class DoubleListListEntry extends BaseListEntry<Double, DoubleListListEnt
                 return 0d;
             }
         }
-        
+
         @Override
         public Optional<String> getError() {
             try {
@@ -132,12 +132,12 @@ public class DoubleListListEntry extends BaseListEntry<Double, DoubleListListEnt
             }
             return Optional.empty();
         }
-        
+
         @Override
         public int getCellHeight() {
             return 20;
         }
-        
+
         @Override
         public void render(int index, int y, int x, int entryWidth, int entryHeight, int mouseX, int mouseY, boolean isSelected, float delta) {
             widget.setWidth(entryWidth - 12);
@@ -149,12 +149,12 @@ public class DoubleListListEntry extends BaseListEntry<Double, DoubleListListEnt
             if (isSelected && listListEntry.isEditable())
                 fill(x, y + 12, x + entryWidth - 12, y + 13, getConfigError().isPresent() ? 0xffff5555 : 0xffe0e0e0);
         }
-        
+
         @Override
         public List<? extends Element> children() {
             return Collections.singletonList(widget);
         }
-        
+
     }
-    
+
 }

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

@@ -23,9 +23,9 @@ import net.minecraft.client.render.VertexFormats;
 import net.minecraft.client.resource.language.I18n;
 import net.minecraft.client.util.Window;
 import net.minecraft.util.math.MathHelper;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
 
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
 import java.util.*;
 import java.util.function.Consumer;
 import java.util.function.Function;
@@ -33,20 +33,22 @@ import java.util.function.Supplier;
 
 @SuppressWarnings("deprecation")
 public class DropdownBoxEntry<T> extends TooltipListEntry<T> {
-    
+
     protected ButtonWidget resetButton;
     protected SelectionElement<T> selectionElement;
-    @Nonnull private Supplier<T> defaultValue;
-    @Nullable private Consumer<T> saveConsumer;
-    
+    @NotNull
+    private Supplier<T> defaultValue;
+    @Nullable
+    private Consumer<T> saveConsumer;
+
     @Deprecated
     public DropdownBoxEntry(String fieldName,
-            @Nonnull String resetButtonKey,
-            @Nullable Supplier<Optional<String[]>> tooltipSupplier, boolean requiresRestart,
-            @Nullable Supplier<T> defaultValue,
-            @Nullable Consumer<T> saveConsumer,
-            @Nullable Iterable<T> selections,
-            @Nonnull SelectionTopCellElement<T> topRenderer, @Nonnull SelectionCellCreator<T> cellCreator) {
+                            @NotNull String resetButtonKey,
+                            @Nullable Supplier<Optional<String[]>> tooltipSupplier, boolean requiresRestart,
+                            @Nullable Supplier<T> defaultValue,
+                            @Nullable Consumer<T> saveConsumer,
+                            @Nullable Iterable<T> selections,
+                            @NotNull SelectionTopCellElement<T> topRenderer, @NotNull SelectionCellCreator<T> cellCreator) {
         super(I18n.translate(fieldName), tooltipSupplier, requiresRestart);
         this.defaultValue = defaultValue;
         this.saveConsumer = saveConsumer;
@@ -56,7 +58,7 @@ public class DropdownBoxEntry<T> extends TooltipListEntry<T> {
         });
         this.selectionElement = new SelectionElement(this, new Rectangle(0, 0, 150, 20), new DefaultDropdownMenuElement(selections == null ? ImmutableList.of() : ImmutableList.copyOf(selections)), topRenderer, cellCreator);
     }
-    
+
     @Override
     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);
@@ -78,58 +80,58 @@ public class DropdownBoxEntry<T> extends TooltipListEntry<T> {
         resetButton.render(mouseX, mouseY, delta);
         selectionElement.render(mouseX, mouseY, delta);
     }
-    
-    @Nonnull
+
+    @NotNull
     public ImmutableList<T> getSelections() {
         return selectionElement.menu.getSelections();
     }
-    
+
     @Override
     public T getValue() {
         return selectionElement.getValue();
     }
-    
+
     @Deprecated
     public SelectionElement<T> getSelectionElement() {
         return selectionElement;
     }
-    
+
     @Override
     public Optional<T> getDefaultValue() {
         return defaultValue == null ? Optional.empty() : Optional.ofNullable(defaultValue.get());
     }
-    
+
     @Override
     public void save() {
         if (saveConsumer != null)
             saveConsumer.accept(getValue());
     }
-    
+
     @Override
     public List<? extends Element> children() {
         return Lists.newArrayList(selectionElement, resetButton);
     }
-    
+
     @Override
     public Optional<String> getError() {
         return selectionElement.topRenderer.getError();
     }
-    
+
     @Override
     public void lateRender(int mouseX, int mouseY, float delta) {
         selectionElement.lateRender(mouseX, mouseY, delta);
     }
-    
+
     @Override
     public int getMorePossibleHeight() {
         return selectionElement.getMorePossibleHeight();
     }
-    
+
     @Override
     public boolean mouseScrolled(double double_1, double double_2, double double_3) {
         return selectionElement.mouseScrolled(double_1, double_2, double_3);
     }
-    
+
     public static class SelectionElement<R> extends AbstractParentElement implements Drawable {
         protected Rectangle bounds;
         protected boolean active;
@@ -137,7 +139,7 @@ public class DropdownBoxEntry<T> extends TooltipListEntry<T> {
         protected DropdownBoxEntry<R> entry;
         protected DropdownMenuElement<R> menu;
         protected boolean dontReFocus = false;
-        
+
         public SelectionElement(DropdownBoxEntry<R> entry, Rectangle bounds, DropdownMenuElement<R> menu, SelectionTopCellElement<R> topRenderer, SelectionCellCreator<R> cellCreator) {
             this.bounds = bounds;
             this.entry = entry;
@@ -148,48 +150,48 @@ public class DropdownBoxEntry<T> extends TooltipListEntry<T> {
             this.topRenderer = Objects.requireNonNull(topRenderer);
             this.topRenderer.entry = entry;
         }
-        
+
         @Override
         public void render(int mouseX, int mouseY, float delta) {
             fill(bounds.x, bounds.y, bounds.x + bounds.width, bounds.y + bounds.height, -6250336);
             fill(bounds.x + 1, bounds.y + 1, bounds.x + bounds.width - 1, bounds.y + bounds.height - 1, -16777216);
             topRenderer.render(mouseX, mouseY, bounds.x, bounds.y, bounds.width, bounds.height, delta);
-            if (menu.isExpended())
+            if (menu.isExpanded())
                 menu.render(mouseX, mouseY, bounds, delta);
         }
-    
+
         @Deprecated
         public SelectionTopCellElement<R> getTopRenderer() {
             return topRenderer;
         }
-    
+
         @Override
         public boolean mouseScrolled(double double_1, double double_2, double double_3) {
-            if (menu.isExpended())
+            if (menu.isExpanded())
                 return menu.mouseScrolled(double_1, double_2, double_3);
             return false;
         }
-        
+
         public void lateRender(int mouseX, int mouseY, float delta) {
-            if (menu.isExpended())
+            if (menu.isExpanded())
                 menu.lateRender(mouseX, mouseY, delta);
         }
-        
+
         public int getMorePossibleHeight() {
-            if (menu.isExpended())
+            if (menu.isExpanded())
                 return menu.getHeight();
             return -1;
         }
-        
+
         public R getValue() {
             return topRenderer.getValue();
         }
-        
+
         @Override
         public List<? extends Element> children() {
             return Lists.newArrayList(topRenderer, menu);
         }
-        
+
         @Override
         public boolean mouseClicked(double double_1, double double_2, int int_1) {
             dontReFocus = false;
@@ -201,90 +203,97 @@ public class DropdownBoxEntry<T> extends TooltipListEntry<T> {
             return b;
         }
     }
-    
+
     public static abstract class DropdownMenuElement<R> extends AbstractParentElement {
-        @Deprecated @Nonnull private SelectionCellCreator<R> cellCreator;
-        @Deprecated @Nonnull private DropdownBoxEntry<R> entry;
-        
-        @Nonnull
+        @Deprecated
+        @NotNull
+        private SelectionCellCreator<R> cellCreator;
+        @Deprecated
+        @NotNull
+        private DropdownBoxEntry<R> entry;
+
+        @NotNull
         public SelectionCellCreator<R> getCellCreator() {
             return cellCreator;
         }
-        
-        @Nonnull
+
+        @NotNull
         public final DropdownBoxEntry<R> getEntry() {
             return entry;
         }
-        
-        @Nonnull
+
+        @NotNull
         public abstract ImmutableList<R> getSelections();
-        
+
         public abstract void initCells();
-        
+
         public abstract void render(int mouseX, int mouseY, Rectangle rectangle, float delta);
-        
+
         public abstract void lateRender(int mouseX, int mouseY, float delta);
-        
+
         public abstract int getHeight();
-        
-        public final boolean isExpended() {
+
+        public final boolean isExpanded() {
             return (getEntry().selectionElement.getFocused() == getEntry().selectionElement.topRenderer || getEntry().selectionElement.getFocused() == getEntry().selectionElement.menu) && getEntry().getFocused() == getEntry().selectionElement && getEntry().getParent().getFocused() == getEntry();
         }
-        
+
         @Override
         public abstract List<SelectionCellElement<R>> children();
     }
-    
+
     public static class DefaultDropdownMenuElement<R> extends DropdownMenuElement<R> {
-        @Nonnull protected ImmutableList<R> selections;
-        @Nonnull protected List<SelectionCellElement<R>> cells;
-        @Nonnull protected List<SelectionCellElement<R>> currentElements;
+        @NotNull
+        protected ImmutableList<R> selections;
+        @NotNull
+        protected List<SelectionCellElement<R>> cells;
+        @NotNull
+        protected List<SelectionCellElement<R>> currentElements;
         protected String lastSearchKeyword = "";
         protected Rectangle lastRectangle;
         protected boolean scrolling;
         protected double scroll, target;
         protected long start;
         protected long duration;
-        
-        public DefaultDropdownMenuElement(@Nonnull ImmutableList<R> selections) {
+
+        public DefaultDropdownMenuElement(@NotNull ImmutableList<R> selections) {
             this.selections = selections;
             this.cells = Lists.newArrayList();
             this.currentElements = Lists.newArrayList();
         }
-        
+
         public final double clamp(double v) {
             return MathHelper.clamp(v, -SmoothScrollingSettings.CLAMP_EXTENSION, getMaxScrollPosition() + SmoothScrollingSettings.CLAMP_EXTENSION);
         }
-        
+
         public double getMaxScroll() {
             return getCellCreator().getCellHeight() * currentElements.size();
         }
-        
+
         protected double getMaxScrollPosition() {
             return Math.max(0, this.getMaxScroll() - (getHeight()));
         }
-        
+
         @Override
-        @Nonnull
+        @NotNull
         public ImmutableList<R> getSelections() {
             return selections;
         }
-        
+
         @Override
         public void initCells() {
-            for(R selection : getSelections()) {
+            for (R selection : getSelections()) {
                 cells.add(getCellCreator().create(selection));
             }
-            for(SelectionCellElement<R> cell : cells) {
+            for (SelectionCellElement<R> cell : cells) {
                 cell.entry = getEntry();
             }
             search();
         }
-        
+
         public void search() {
             currentElements.clear();
             String keyword = this.lastSearchKeyword.toLowerCase();
-            for(SelectionCellElement<R> cell : cells) {
+            for (SelectionCellElement<R> cell : cells) {
                 String key = cell.getSearchKey();
                 if (key == null || key.toLowerCase().contains(keyword))
                     currentElements.add(cell);
@@ -295,15 +304,15 @@ public class DropdownBoxEntry<T> extends TooltipListEntry<T> {
             }
             scrollTo(0, false);
         }
-        
+
         protected int editDistance(String s1, String s2) {
             s1 = s1.toLowerCase();
             s2 = s2.toLowerCase();
-            
+
             int[] costs = new int[s2.length() + 1];
-            for(int i = 0; i <= s1.length(); i++) {
+            for (int i = 0; i <= s1.length(); i++) {
                 int lastValue = i;
-                for(int j = 0; j <= s2.length(); j++) {
+                for (int j = 0; j <= s2.length(); j++) {
                     if (i == 0)
                         costs[j] = j;
                     else {
@@ -321,7 +330,7 @@ public class DropdownBoxEntry<T> extends TooltipListEntry<T> {
             }
             return costs[s2.length()];
         }
-        
+
         protected double similarity(String s1, String s2) {
             String longer = s1, shorter = s2;
             if (s1.length() < s2.length()) { // longer should always have greater length
@@ -334,7 +343,7 @@ public class DropdownBoxEntry<T> extends TooltipListEntry<T> {
             }
             return (longerLength - editDistance(longer, shorter)) / (double) longerLength;
         }
-        
+
         @Override
         public void render(int mouseX, int mouseY, Rectangle rectangle, float delta) {
             if (!getEntry().selectionElement.topRenderer.getSearchTerm().equals(lastSearchKeyword)) {
@@ -345,7 +354,7 @@ public class DropdownBoxEntry<T> extends TooltipListEntry<T> {
             lastRectangle = rectangle.clone();
             lastRectangle.translate(0, -1);
         }
-        
+
         private void updatePosition(float delta) {
             target = clamp(target);
             if (target < 0) {
@@ -358,7 +367,7 @@ public class DropdownBoxEntry<T> extends TooltipListEntry<T> {
             else
                 scroll = target;
         }
-        
+
         @Override
         public void lateRender(int mouseX, int mouseY, float delta) {
             int last10Height = getHeight();
@@ -367,10 +376,10 @@ public class DropdownBoxEntry<T> extends TooltipListEntry<T> {
             fill(lastRectangle.x + 1, lastRectangle.y + lastRectangle.height + 1, lastRectangle.x + cWidth - 1, lastRectangle.y + lastRectangle.height + last10Height, -16777216);
             RenderSystem.pushMatrix();
             RenderSystem.translatef(0, 0, 300f);
-            
+
             ScissorsHandler.INSTANCE.scissor(new Rectangle(lastRectangle.x, lastRectangle.y + lastRectangle.height + 1, cWidth - 6, last10Height - 1));
             double yy = lastRectangle.y + lastRectangle.height - scroll;
-            for(SelectionCellElement<R> cell : currentElements) {
+            for (SelectionCellElement<R> cell : currentElements) {
                 if (yy + getCellCreator().getCellHeight() >= lastRectangle.y + lastRectangle.height && yy <= lastRectangle.y + lastRectangle.height + last10Height + 1)
                     cell.render(mouseX, mouseY, lastRectangle.x, (int) yy, getMaxScrollPosition() > 6 ? getCellCreator().getCellWidth() - 6 : getCellCreator().getCellWidth(), getCellCreator().getCellHeight(), delta);
                 else
@@ -378,13 +387,13 @@ public class DropdownBoxEntry<T> extends TooltipListEntry<T> {
                 yy += getCellCreator().getCellHeight();
             }
             ScissorsHandler.INSTANCE.removeLastScissor();
-            
+
             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);
             }
-            
+
             if (getMaxScrollPosition() > 6) {
                 RenderSystem.disableTexture();
                 int scrollbarPositionMinX = lastRectangle.x + getCellCreator().getCellWidth() - 6;
@@ -394,13 +403,13 @@ public class DropdownBoxEntry<T> extends TooltipListEntry<T> {
                 height -= Math.min((scroll < 0 ? (int) -scroll : scroll > getMaxScrollPosition() ? (int) scroll - getMaxScrollPosition() : 0), height * .95);
                 height = Math.max(10, height);
                 int minY = (int) Math.min(Math.max((int) scroll * (last10Height - height) / getMaxScrollPosition() + (lastRectangle.y + lastRectangle.height + 1), (lastRectangle.y + lastRectangle.height + 1)), (lastRectangle.y + lastRectangle.height + 1 + last10Height) - height);
-                
+
                 int bottomc = new Rectangle(scrollbarPositionMinX, minY, scrollbarPositionMaxX - scrollbarPositionMinX, height).contains(PointHelper.fromMouse()) ? 168 : 128;
                 int topc = new Rectangle(scrollbarPositionMinX, minY, scrollbarPositionMaxX - scrollbarPositionMinX, height).contains(PointHelper.fromMouse()) ? 222 : 172;
-                
+
                 Tessellator tessellator = Tessellator.getInstance();
                 BufferBuilder buffer = tessellator.getBuffer();
-                
+
                 // Bottom
                 buffer.begin(7, VertexFormats.POSITION_TEXTURE_COLOR);
                 buffer.vertex(scrollbarPositionMinX, minY + height, 0.0D).texture(0, 1).color(bottomc, bottomc, bottomc, 255).next();
@@ -408,7 +417,7 @@ public class DropdownBoxEntry<T> extends TooltipListEntry<T> {
                 buffer.vertex(scrollbarPositionMaxX, minY, 0.0D).texture(1, 0).color(bottomc, bottomc, bottomc, 255).next();
                 buffer.vertex(scrollbarPositionMinX, minY, 0.0D).texture(0, 0).color(bottomc, bottomc, bottomc, 255).next();
                 tessellator.draw();
-                
+
                 // Top
                 buffer.begin(7, VertexFormats.POSITION_TEXTURE_COLOR);
                 buffer.vertex(scrollbarPositionMinX, (minY + height - 1), 0.0D).texture(0, 1).color(topc, topc, topc, 255).next();
@@ -421,20 +430,20 @@ public class DropdownBoxEntry<T> extends TooltipListEntry<T> {
             RenderSystem.translatef(0, 0, -300f);
             RenderSystem.popMatrix();
         }
-        
+
         @Override
         public int getHeight() {
             return Math.max(Math.min(getCellCreator().getDropBoxMaxHeight(), (int) getMaxScroll()), 14);
         }
-        
+
         @Override
         public boolean isMouseOver(double mouseX, double mouseY) {
-            return isExpended() && mouseX >= lastRectangle.x && mouseX <= lastRectangle.x + getCellCreator().getCellWidth() && mouseY >= lastRectangle.y + lastRectangle.height && mouseY <= lastRectangle.y + lastRectangle.height + getHeight() + 1;
+            return isExpanded() && mouseX >= lastRectangle.x && mouseX <= lastRectangle.x + getCellCreator().getCellWidth() && mouseY >= lastRectangle.y + lastRectangle.height && mouseY <= lastRectangle.y + lastRectangle.height + getHeight() + 1;
         }
-        
+
         @Override
         public boolean mouseDragged(double double_1, double double_2, int int_1, double double_3, double double_4) {
-            if (!isExpended())
+            if (!isExpanded())
                 return false;
             if (int_1 == 0 && this.scrolling) {
                 if (double_2 < (double) lastRectangle.y + lastRectangle.height) {
@@ -453,7 +462,7 @@ public class DropdownBoxEntry<T> extends TooltipListEntry<T> {
             }
             return false;
         }
-        
+
         @Override
         public boolean mouseScrolled(double mouseX, double mouseY, double double_3) {
             if (isMouseOver(mouseX, mouseY)) {
@@ -462,101 +471,103 @@ public class DropdownBoxEntry<T> extends TooltipListEntry<T> {
             }
             return false;
         }
-        
+
         protected void updateScrollingState(double double_1, double double_2, int int_1) {
-            this.scrolling = isExpended() && lastRectangle != null && int_1 == 0 && double_1 >= (double) lastRectangle.x + getCellCreator().getCellWidth() - 6 && double_1 < (double) (lastRectangle.x + getCellCreator().getCellWidth());
+            this.scrolling = isExpanded() && lastRectangle != null && int_1 == 0 && double_1 >= (double) lastRectangle.x + getCellCreator().getCellWidth() - 6 && double_1 < (double) (lastRectangle.x + getCellCreator().getCellWidth());
         }
-        
+
         @Override
         public boolean mouseClicked(double double_1, double double_2, int int_1) {
-            if (!isExpended())
+            if (!isExpanded())
                 return false;
             updateScrollingState(double_1, double_2, int_1);
             return super.mouseClicked(double_1, double_2, int_1) || scrolling;
         }
-        
+
         public void offset(double value, boolean animated) {
             scrollTo(target + value, animated);
         }
-        
+
         public void scrollTo(double value, boolean animated) {
             scrollTo(value, animated, ClothConfigInitializer.getScrollDuration());
         }
-        
+
         public void scrollTo(double value, boolean animated, long duration) {
             target = clamp(value);
-            
+
             if (animated) {
                 start = System.currentTimeMillis();
                 this.duration = duration;
             } else
                 scroll = target;
         }
-        
+
         @Override
         public List<SelectionCellElement<R>> children() {
             return currentElements;
         }
     }
-    
+
     public static abstract class SelectionCellCreator<R> {
         public abstract SelectionCellElement<R> create(R selection);
-        
+
         public abstract int getCellHeight();
-        
+
         public abstract int getDropBoxMaxHeight();
-        
+
         public int getCellWidth() {
             return 132;
         }
     }
-    
+
     public static class DefaultSelectionCellCreator<R> extends SelectionCellCreator<R> {
         protected Function<R, String> toStringFunction;
-        
+
         public DefaultSelectionCellCreator(Function<R, String> toStringFunction) {
             this.toStringFunction = toStringFunction;
         }
-        
+
         public DefaultSelectionCellCreator() {
             this(Object::toString);
         }
-        
+
         @Override
         public SelectionCellElement<R> create(R selection) {
             return new DefaultSelectionCellElement<>(selection, toStringFunction);
         }
-        
+
         @Override
         public int getCellHeight() {
             return 14;
         }
-        
+
         @Override
         public int getDropBoxMaxHeight() {
             return getCellHeight() * 7;
         }
     }
-    
+
     public static abstract class SelectionCellElement<R> extends AbstractParentElement {
-        @Deprecated @Nonnull private DropdownBoxEntry<R> entry;
-        
-        @Nonnull
+        @Deprecated
+        @NotNull
+        private DropdownBoxEntry<R> entry;
+
+        @NotNull
         public final DropdownBoxEntry<R> getEntry() {
             return entry;
         }
-        
+
         public abstract void render(int mouseX, int mouseY, int x, int y, int width, int height, float delta);
-        
+
         public abstract void dontRender(float delta);
-        
+
         @Nullable
         public abstract String getSearchKey();
-        
+
         @Nullable
         public abstract R getSelection();
     }
-    
+
     public static class DefaultSelectionCellElement<R> extends SelectionCellElement<R> {
         protected R r;
         protected int x;
@@ -565,12 +576,12 @@ public class DropdownBoxEntry<T> extends TooltipListEntry<T> {
         protected int height;
         protected boolean rendering;
         protected Function<R, String> toStringFunction;
-        
+
         public DefaultSelectionCellElement(R r, Function<R, String> toStringFunction) {
             this.r = r;
             this.toStringFunction = toStringFunction;
         }
-        
+
         @Override
         public void render(int mouseX, int mouseY, int x, int y, int width, int height, float delta) {
             rendering = true;
@@ -583,29 +594,29 @@ public class DropdownBoxEntry<T> extends TooltipListEntry<T> {
                 fill(x + 1, y + 1, x + width - 1, y + height - 1, -15132391);
             MinecraftClient.getInstance().textRenderer.drawWithShadow(toStringFunction.apply(r), x + 6, y + 3, b ? 16777215 : 8947848);
         }
-        
+
         @Override
         public void dontRender(float delta) {
             rendering = false;
         }
-        
+
         @Nullable
         @Override
         public String getSearchKey() {
             return toStringFunction.apply(r);
         }
-        
+
         @Nullable
         @Override
         public R getSelection() {
             return r;
         }
-        
+
         @Override
         public List<? extends Element> children() {
             return Collections.emptyList();
         }
-        
+
         @Override
         public boolean mouseClicked(double mouseX, double mouseY, int int_1) {
             boolean b = rendering && mouseX >= x && mouseX <= x + width && mouseY >= y && mouseY <= y + height;
@@ -618,37 +629,38 @@ public class DropdownBoxEntry<T> extends TooltipListEntry<T> {
             return false;
         }
     }
-    
+
     public static abstract class SelectionTopCellElement<R> extends AbstractParentElement {
-        @Deprecated private DropdownBoxEntry<R> entry;
-        
+        @Deprecated
+        private DropdownBoxEntry<R> entry;
+
         public abstract R getValue();
-        
+
         public abstract void setValue(R value);
-        
+
         public abstract String getSearchTerm();
-        
+
         public abstract Optional<String> getError();
-        
+
         public final Optional<String> getConfigError() {
             return entry.getConfigError();
         }
-        
+
         public DropdownBoxEntry<R> getParent() {
             return entry;
         }
-        
+
         public final boolean hasConfigError() {
             return getConfigError().isPresent();
         }
-        
+
         public final int getPreferredTextColor() {
             return getConfigError().isPresent() ? 16733525 : 16777215;
         }
-        
+
         public void selectFirstRecommendation() {
             List<SelectionCellElement<R>> children = getParent().selectionElement.menu.children();
-            for(SelectionCellElement<R> child : children) {
+            for (SelectionCellElement<R> child : children) {
                 if (child.getSelection() != null) {
                     setValue(child.getSelection());
                     getParent().selectionElement.setFocused(null);
@@ -656,16 +668,16 @@ public class DropdownBoxEntry<T> extends TooltipListEntry<T> {
                 }
             }
         }
-        
+
         public abstract void render(int mouseX, int mouseY, int x, int y, int width, int height, float delta);
     }
-    
+
     public static class DefaultSelectionTopCellElement<R> extends SelectionTopCellElement<R> {
         protected TextFieldWidget textFieldWidget;
         protected Function<String, R> toObjectFunction;
         protected Function<R, String> toStringFunction;
         protected R value;
-        
+
         public DefaultSelectionTopCellElement(R value, Function<String, R> toObjectFunction, Function<R, String> toStringFunction) {
             this.value = Objects.requireNonNull(value);
             this.toObjectFunction = Objects.requireNonNull(toObjectFunction);
@@ -678,7 +690,7 @@ public class DropdownBoxEntry<T> extends TooltipListEntry<T> {
                     super.render(int_1, int_2, float_1);
                     setFocused(f);
                 }
-                
+
                 @Override
                 public boolean keyPressed(int int_1, int int_2, int int_3) {
                     if (int_1 == 257 || int_1 == 335) {
@@ -696,7 +708,7 @@ public class DropdownBoxEntry<T> extends TooltipListEntry<T> {
                     getParent().getScreen().setEdited(true, getParent().isRequiresRestart());
             });
         }
-        
+
         @Override
         public void render(int mouseX, int mouseY, int x, int y, int width, int height, float delta) {
             textFieldWidget.x = x + 4;
@@ -706,32 +718,32 @@ public class DropdownBoxEntry<T> extends TooltipListEntry<T> {
             textFieldWidget.setEditableColor(getPreferredTextColor());
             textFieldWidget.render(mouseX, mouseY, delta);
         }
-        
+
         @Override
         public R getValue() {
             if (hasConfigError())
                 return value;
             return toObjectFunction.apply(textFieldWidget.getText());
         }
-        
+
         @Override
         public void setValue(R value) {
             textFieldWidget.setText(toStringFunction.apply(value));
             textFieldWidget.setCursor(0);
         }
-        
+
         @Override
         public String getSearchTerm() {
             return textFieldWidget.getText();
         }
-        
+
         @Override
         public Optional<String> getError() {
             if (toObjectFunction.apply(textFieldWidget.getText()) != null)
                 return Optional.empty();
             return Optional.of("Invalid Value!");
         }
-        
+
         @Override
         public List<? extends Element> children() {
             return Collections.singletonList(textFieldWidget);

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

@@ -7,8 +7,8 @@ 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.NotNull;
 
-import javax.annotation.Nonnull;
 import java.util.List;
 import java.util.Optional;
 import java.util.concurrent.atomic.AtomicInteger;
@@ -120,7 +120,7 @@ public class SelectionListEntry<T> extends TooltipListEntry<T> {
     }
     
     public static interface Translatable {
-        @Nonnull
+        @NotNull
         String getKey();
     }
     

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

@@ -16,20 +16,20 @@ import java.util.List;
 import java.util.Optional;
 
 public class SubCategoryListEntry extends TooltipListEntry<List<AbstractConfigListEntry>> {
-    
+
     private static final Identifier CONFIG_TEX = new Identifier("cloth-config2", "textures/gui/cloth_config.png");
     private String categoryName;
     private List<AbstractConfigListEntry> entries;
     private CategoryLabelWidget widget;
     private List<Element> children;
-    private boolean expended;
-    
+    private boolean expanded;
+
     @Deprecated
-    public SubCategoryListEntry(String categoryName, List<AbstractConfigListEntry> entries, boolean defaultExpended) {
+    public SubCategoryListEntry(String categoryName, List<AbstractConfigListEntry> entries, boolean defaultExpanded) {
         super(categoryName, null);
         this.categoryName = categoryName;
         this.entries = entries;
-        this.expended = defaultExpended;
+        this.expanded = defaultExpanded;
         this.widget = new CategoryLabelWidget();
         this.children = Lists.newArrayList(widget);
         this.children.addAll(entries);
@@ -72,15 +72,15 @@ public class SubCategoryListEntry extends TooltipListEntry<List<AbstractConfigLi
         MinecraftClient.getInstance().getTextureManager().bindTexture(CONFIG_TEX);
         DiffuseLighting.disable();
         RenderSystem.color4f(1, 1, 1, 1);
-        blit(x - 15, y + 4, 24, (widget.rectangle.contains(mouseX, mouseY) ? 18 : 0) + (expended ? 9 : 0), 9, 9);
+        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) {
             entry.setParent(getParent());
             entry.setScreen(getScreen());
         }
-        if (expended) {
+        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();
             }
@@ -98,9 +98,9 @@ public class SubCategoryListEntry extends TooltipListEntry<List<AbstractConfigLi
     
     @Override
     public int getItemHeight() {
-        if (expended) {
+        if (expanded) {
             int i = 24;
-            for(AbstractConfigListEntry entry : entries)
+            for (AbstractConfigListEntry entry : entries)
                 i += entry.getItemHeight();
             return i;
         }
@@ -135,7 +135,7 @@ public class SubCategoryListEntry extends TooltipListEntry<List<AbstractConfigLi
         @Override
         public boolean mouseClicked(double double_1, double double_2, int int_1) {
             if (rectangle.contains(double_1, double_2)) {
-                expended = !expended;
+                expanded = !expanded;
                 MinecraftClient.getInstance().getSoundManager().play(PositionedSoundInstance.master(SoundEvents.UI_BUTTON_CLICK, 1.0F));
                 return true;
             }

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

@@ -3,23 +3,24 @@ package me.shedaniel.clothconfig2.gui.entries;
 import me.shedaniel.clothconfig2.api.AbstractConfigListEntry;
 import me.shedaniel.clothconfig2.api.QueuedTooltip;
 import me.shedaniel.math.api.Point;
+import org.jetbrains.annotations.Nullable;
 
-import javax.annotation.Nullable;
 import java.util.Optional;
 import java.util.function.Supplier;
 
 public abstract class TooltipListEntry<T> extends AbstractConfigListEntry<T> {
-    
-    @Nullable private Supplier<Optional<String[]>> tooltipSupplier;
-    
+
+    @Nullable
+    private Supplier<Optional<String[]>> tooltipSupplier;
+
     @Deprecated
     public TooltipListEntry(String fieldName, @Nullable Supplier<Optional<String[]>> tooltipSupplier) {
         this(fieldName, tooltipSupplier, false);
     }
-    
+
     @Deprecated
     public TooltipListEntry(String fieldName,
-            @Nullable Supplier<Optional<String[]>> tooltipSupplier, boolean requiresRestart) {
+                            @Nullable Supplier<Optional<String[]>> tooltipSupplier, boolean requiresRestart) {
         super(fieldName, requiresRestart);
         this.tooltipSupplier = tooltipSupplier;
     }

+ 27 - 23
src/main/java/me/shedaniel/clothconfig2/impl/builders/BooleanToggleBuilder.java

@@ -1,81 +1,85 @@
 package me.shedaniel.clothconfig2.impl.builders;
 
 import me.shedaniel.clothconfig2.gui.entries.BooleanListEntry;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
 
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
 import java.util.Optional;
 import java.util.function.Consumer;
 import java.util.function.Function;
 import java.util.function.Supplier;
 
 public class BooleanToggleBuilder extends FieldBuilder<Boolean, BooleanListEntry> {
-    
-    @Nullable private Consumer<Boolean> saveConsumer = null;
-    @Nonnull private Function<Boolean, Optional<String[]>> tooltipSupplier = bool -> Optional.empty();
+
+    @Nullable
+    private Consumer<Boolean> saveConsumer = null;
+    @NotNull
+    private Function<Boolean, Optional<String[]>> tooltipSupplier = bool -> Optional.empty();
     private boolean value;
-    @Nullable private Function<Boolean, String> yesNoTextSupplier = null;
-    
+    @Nullable
+    private Function<Boolean, String> yesNoTextSupplier = null;
+
     public BooleanToggleBuilder(String resetButtonKey, String fieldNameKey, boolean value) {
         super(resetButtonKey, fieldNameKey);
         this.value = value;
     }
-    
+
     public BooleanToggleBuilder setErrorSupplier(@Nullable Function<Boolean, Optional<String>> errorSupplier) {
         this.errorSupplier = errorSupplier;
         return this;
     }
-    
+
     public BooleanToggleBuilder requireRestart() {
         requireRestart(true);
         return this;
     }
-    
+
     public BooleanToggleBuilder setSaveConsumer(Consumer<Boolean> saveConsumer) {
         this.saveConsumer = saveConsumer;
         return this;
     }
-    
+
     public BooleanToggleBuilder setDefaultValue(Supplier<Boolean> defaultValue) {
         this.defaultValue = defaultValue;
         return this;
     }
-    
+
     public BooleanToggleBuilder setDefaultValue(boolean defaultValue) {
         this.defaultValue = () -> defaultValue;
         return this;
     }
-    
-    public BooleanToggleBuilder setTooltipSupplier(@Nonnull Function<Boolean, Optional<String[]>> tooltipSupplier) {
+
+    public BooleanToggleBuilder setTooltipSupplier(@NotNull Function<Boolean, Optional<String[]>> tooltipSupplier) {
         this.tooltipSupplier = tooltipSupplier;
         return this;
     }
-    
-    public BooleanToggleBuilder setTooltipSupplier(@Nonnull Supplier<Optional<String[]>> tooltipSupplier) {
+
+    public BooleanToggleBuilder setTooltipSupplier(@NotNull Supplier<Optional<String[]>> tooltipSupplier) {
         this.tooltipSupplier = bool -> tooltipSupplier.get();
         return this;
     }
-    
+
     public BooleanToggleBuilder setTooltip(Optional<String[]> tooltip) {
         this.tooltipSupplier = bool -> tooltip;
         return this;
     }
-    
+
     public BooleanToggleBuilder setTooltip(@Nullable String... tooltip) {
         this.tooltipSupplier = bool -> Optional.ofNullable(tooltip);
         return this;
     }
-    
+
     @Nullable
     public Function<Boolean, String> getYesNoTextSupplier() {
         return yesNoTextSupplier;
     }
-    
+
     public BooleanToggleBuilder setYesNoTextSupplier(@Nullable Function<Boolean, String> yesNoTextSupplier) {
         this.yesNoTextSupplier = yesNoTextSupplier;
         return this;
     }
-    
+
+    @NotNull
     @Override
     public BooleanListEntry build() {
         BooleanListEntry entry = new BooleanListEntry(getFieldNameKey(), value, getResetButtonKey(), defaultValue, saveConsumer, null, isRequireRestart()) {
@@ -91,5 +95,5 @@ public class BooleanToggleBuilder extends FieldBuilder<Boolean, BooleanListEntry
             entry.setErrorSupplier(() -> errorSupplier.apply(entry.getValue()));
         return entry;
     }
-    
-}
+
+}

+ 6 - 4
src/main/java/me/shedaniel/clothconfig2/impl/builders/DoubleFieldBuilder.java

@@ -1,6 +1,7 @@
 package me.shedaniel.clothconfig2.impl.builders;
 
 import me.shedaniel.clothconfig2.gui.entries.DoubleListEntry;
+import org.jetbrains.annotations.NotNull;
 
 import java.util.Optional;
 import java.util.function.Consumer;
@@ -73,17 +74,18 @@ public class DoubleFieldBuilder extends FieldBuilder<Double, DoubleListEntry> {
         this.tooltipSupplier = d -> tooltipSupplier.get();
         return this;
     }
-    
+
     public DoubleFieldBuilder setTooltip(Optional<String[]> tooltip) {
         this.tooltipSupplier = d -> tooltip;
         return this;
     }
-    
+
     public DoubleFieldBuilder setTooltip(String... tooltip) {
         this.tooltipSupplier = d -> Optional.ofNullable(tooltip);
         return this;
     }
-    
+
+    @NotNull
     @Override
     public DoubleListEntry build() {
         DoubleListEntry entry = new DoubleListEntry(getFieldNameKey(), value, getResetButtonKey(), defaultValue, saveConsumer, null, isRequireRestart());
@@ -97,4 +99,4 @@ public class DoubleFieldBuilder extends FieldBuilder<Double, DoubleListEntry> {
         return entry;
     }
     
-}
+}

+ 28 - 28
src/main/java/me/shedaniel/clothconfig2/impl/builders/DoubleListBuilder.java

@@ -2,8 +2,8 @@ package me.shedaniel.clothconfig2.impl.builders;
 
 import me.shedaniel.clothconfig2.gui.entries.DoubleListListEntry;
 import net.minecraft.client.resource.language.I18n;
+import org.jetbrains.annotations.NotNull;
 
-import javax.annotation.Nonnull;
 import java.util.List;
 import java.util.Optional;
 import java.util.function.Consumer;
@@ -11,56 +11,56 @@ import java.util.function.Function;
 import java.util.function.Supplier;
 
 public class DoubleListBuilder extends FieldBuilder<List<Double>, DoubleListListEntry> {
-    
+
     protected Function<Double, Optional<String>> cellErrorSupplier;
     private Consumer<List<Double>> saveConsumer = null;
     private Function<List<Double>, Optional<String[]>> tooltipSupplier = list -> Optional.empty();
     private List<Double> value;
-    private boolean expended = false;
+    private boolean expanded = false;
     private Double min = null, max = null;
     private Function<DoubleListListEntry, DoubleListListEntry.DoubleListCell> createNewInstance;
     private String addTooltip = I18n.translate("text.cloth-config.list.add"), removeTooltip = I18n.translate("text.cloth-config.list.remove");
     private boolean deleteButtonEnabled = true, insertInFront = true;
-    
+
     public DoubleListBuilder(String resetButtonKey, String fieldNameKey, List<Double> value) {
         super(resetButtonKey, fieldNameKey);
         this.value = value;
     }
-    
+
     public Function<Double, Optional<String>> getCellErrorSupplier() {
         return cellErrorSupplier;
     }
-    
+
     public DoubleListBuilder setCellErrorSupplier(Function<Double, Optional<String>> cellErrorSupplier) {
         this.cellErrorSupplier = cellErrorSupplier;
         return this;
     }
-    
+
     public DoubleListBuilder setErrorSupplier(Function<List<Double>, Optional<String>> errorSupplier) {
         this.errorSupplier = errorSupplier;
         return this;
     }
-    
+
     public DoubleListBuilder setDeleteButtonEnabled(boolean deleteButtonEnabled) {
         this.deleteButtonEnabled = deleteButtonEnabled;
         return this;
     }
-    
+
     public DoubleListBuilder setInsertInFront(boolean insertInFront) {
         this.insertInFront = insertInFront;
         return this;
     }
-    
+
     public DoubleListBuilder setAddButtonTooltip(String addTooltip) {
         this.addTooltip = addTooltip;
         return this;
     }
-    
+
     public DoubleListBuilder setRemoveButtonTooltip(String removeTooltip) {
         this.removeTooltip = removeTooltip;
         return this;
     }
-    
+
     public DoubleListBuilder requireRestart() {
         requireRestart(true);
         return this;
@@ -70,68 +70,68 @@ public class DoubleListBuilder extends FieldBuilder<List<Double>, DoubleListList
         this.createNewInstance = createNewInstance;
         return this;
     }
-    
-    public DoubleListBuilder setExpended(boolean expended) {
-        this.expended = expended;
+
+    public DoubleListBuilder setExpanded(boolean expanded) {
+        this.expanded = expanded;
         return this;
     }
-    
+
     public DoubleListBuilder setSaveConsumer(Consumer<List<Double>> saveConsumer) {
         this.saveConsumer = saveConsumer;
         return this;
     }
-    
+
     public DoubleListBuilder setDefaultValue(Supplier<List<Double>> defaultValue) {
         this.defaultValue = defaultValue;
         return this;
     }
-    
+
     public DoubleListBuilder setMin(double min) {
         this.min = min;
         return this;
     }
-    
+
     public DoubleListBuilder setMax(double max) {
         this.max = max;
         return this;
     }
-    
+
     public DoubleListBuilder removeMin() {
         this.min = null;
         return this;
     }
-    
+
     public DoubleListBuilder removeMax() {
         this.max = null;
         return this;
     }
-    
+
     public DoubleListBuilder setDefaultValue(List<Double> defaultValue) {
         this.defaultValue = () -> defaultValue;
         return this;
     }
-    
+
     public DoubleListBuilder setTooltipSupplier(Function<List<Double>, Optional<String[]>> tooltipSupplier) {
         this.tooltipSupplier = tooltipSupplier;
         return this;
     }
-    
+
     public DoubleListBuilder setTooltipSupplier(Supplier<Optional<String[]>> tooltipSupplier) {
         this.tooltipSupplier = list -> tooltipSupplier.get();
         return this;
     }
-    
+
     public DoubleListBuilder setTooltip(Optional<String[]> tooltip) {
         this.tooltipSupplier = list -> tooltip;
         return this;
     }
-    
+
     public DoubleListBuilder setTooltip(String... tooltip) {
         this.tooltipSupplier = list -> Optional.ofNullable(tooltip);
         return this;
     }
 
-    @Nonnull
+    @NotNull
     @Override
     public DoubleListListEntry build() {
         DoubleListListEntry entry = new DoubleListListEntry(getFieldNameKey(), value, expended, null, saveConsumer, defaultValue, getResetButtonKey(), isRequireRestart()) {
@@ -159,5 +159,5 @@ public class DoubleListBuilder extends FieldBuilder<List<Double>, DoubleListList
             entry.setErrorSupplier(() -> errorSupplier.apply(entry.getValue()));
         return entry;
     }
-    
+
 }

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

@@ -13,8 +13,8 @@ import net.minecraft.item.ItemStack;
 import net.minecraft.item.Items;
 import net.minecraft.util.Identifier;
 import net.minecraft.util.registry.Registry;
+import org.jetbrains.annotations.NotNull;
 
-import javax.annotation.Nonnull;
 import java.util.Collections;
 import java.util.Objects;
 import java.util.Optional;
@@ -74,18 +74,18 @@ public class DropdownMenuBuilder<T> extends FieldBuilder<T, DropdownBoxEntry<T>>
         this.tooltipSupplier = str -> Optional.ofNullable(tooltip);
         return this;
     }
-    
+
     public DropdownMenuBuilder<T> requireRestart() {
         requireRestart(true);
         return this;
     }
-    
+
     public DropdownMenuBuilder<T> setErrorSupplier(Function<T, Optional<String>> errorSupplier) {
         this.errorSupplier = errorSupplier;
         return this;
     }
-    
-    @Nonnull
+
+    @NotNull
     @Override
     public DropdownBoxEntry<T> build() {
         DropdownBoxEntry<T> entry = new DropdownBoxEntry<T>(getFieldNameKey(), getResetButtonKey(), null, isRequireRestart(), defaultValue, saveConsumer, selections, topCellElement, cellCreator);
@@ -94,7 +94,7 @@ public class DropdownMenuBuilder<T> extends FieldBuilder<T, DropdownBoxEntry<T>>
             entry.setErrorSupplier(() -> errorSupplier.apply(entry.getValue()));
         return entry;
     }
-    
+
     public static class TopCellElementBuilder {
         public static final Function<String, Identifier> IDENTIFIER_FUNCTION = str -> {
             try {

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

@@ -1,6 +1,7 @@
 package me.shedaniel.clothconfig2.impl.builders;
 
 import me.shedaniel.clothconfig2.gui.entries.EnumListEntry;
+import org.jetbrains.annotations.NotNull;
 
 import java.util.Objects;
 import java.util.Optional;
@@ -64,18 +65,19 @@ public class EnumSelectorBuilder<T extends Enum<?>> extends FieldBuilder<T, Enum
         this.tooltipSupplier = e -> tooltip;
         return this;
     }
-    
+
     public EnumSelectorBuilder<T> setTooltip(String... tooltip) {
         this.tooltipSupplier = e -> Optional.ofNullable(tooltip);
         return this;
     }
-    
+
     public EnumSelectorBuilder<T> setEnumNameProvider(Function<Enum, String> enumNameProvider) {
         Objects.requireNonNull(enumNameProvider);
         this.enumNameProvider = enumNameProvider;
         return this;
     }
-    
+
+    @NotNull
     @Override
     public EnumListEntry<T> build() {
         EnumListEntry<T> entry = new EnumListEntry<>(getFieldNameKey(), clazz, value, getResetButtonKey(), defaultValue, saveConsumer, enumNameProvider, null, isRequireRestart());
@@ -84,5 +86,5 @@ public class EnumSelectorBuilder<T extends Enum<?>> extends FieldBuilder<T, Enum
             entry.setErrorSupplier(() -> errorSupplier.apply(entry.getValue()));
         return entry;
     }
-    
+
 }

+ 24 - 19
src/main/java/me/shedaniel/clothconfig2/impl/builders/FieldBuilder.java

@@ -1,55 +1,60 @@
 package me.shedaniel.clothconfig2.impl.builders;
 
 import me.shedaniel.clothconfig2.api.AbstractConfigListEntry;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
 
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
 import java.util.Objects;
 import java.util.Optional;
 import java.util.function.Function;
 import java.util.function.Supplier;
 
 public abstract class FieldBuilder<T, A extends AbstractConfigListEntry> {
-    @Nonnull private final String fieldNameKey;
-    @Nonnull private final String resetButtonKey;
+    @NotNull
+    private final String fieldNameKey;
+    @NotNull
+    private final String resetButtonKey;
     protected boolean requireRestart = false;
-    @Nullable protected Supplier<T> defaultValue = null;
-    @Nullable protected Function<T, Optional<String>> errorSupplier;
-    
+    @Nullable
+    protected Supplier<T> defaultValue = null;
+    @Nullable
+    protected Function<T, Optional<String>> errorSupplier;
+
     protected FieldBuilder(String resetButtonKey, String fieldNameKey) {
         this.resetButtonKey = Objects.requireNonNull(resetButtonKey);
         this.fieldNameKey = Objects.requireNonNull(fieldNameKey);
     }
-    
+
     @Nullable
     public final Supplier<T> getDefaultValue() {
         return defaultValue;
     }
-    
+
+    @SuppressWarnings("rawtypes")
     @Deprecated
     public final AbstractConfigListEntry buildEntry() {
         return build();
     }
-    
-    @Nonnull
+
+    @NotNull
     public abstract A build();
-    
-    @Nonnull
+
+    @NotNull
     public final String getFieldNameKey() {
         return fieldNameKey;
     }
-    
-    @Nonnull
+
+    @NotNull
     public final String getResetButtonKey() {
         return resetButtonKey;
     }
-    
+
     public boolean isRequireRestart() {
         return requireRestart;
     }
-    
+
     public void requireRestart(boolean requireRestart) {
         this.requireRestart = requireRestart;
     }
-    
-}
+
+}

+ 6 - 4
src/main/java/me/shedaniel/clothconfig2/impl/builders/FloatFieldBuilder.java

@@ -1,6 +1,7 @@
 package me.shedaniel.clothconfig2.impl.builders;
 
 import me.shedaniel.clothconfig2.gui.entries.FloatListEntry;
+import org.jetbrains.annotations.NotNull;
 
 import java.util.Optional;
 import java.util.function.Consumer;
@@ -73,17 +74,18 @@ public class FloatFieldBuilder extends FieldBuilder<Float, FloatListEntry> {
         this.max = max;
         return this;
     }
-    
+
     public FloatFieldBuilder removeMin() {
         this.min = null;
         return this;
     }
-    
+
     public FloatFieldBuilder removeMax() {
         this.max = null;
         return this;
     }
-    
+
+    @NotNull
     @Override
     public FloatListEntry build() {
         FloatListEntry entry = new FloatListEntry(getFieldNameKey(), value, getResetButtonKey(), defaultValue, saveConsumer, null, isRequireRestart());
@@ -97,4 +99,4 @@ public class FloatFieldBuilder extends FieldBuilder<Float, FloatListEntry> {
         return entry;
     }
     
-}
+}

+ 5 - 5
src/main/java/me/shedaniel/clothconfig2/impl/builders/FloatListBuilder.java

@@ -2,8 +2,8 @@ package me.shedaniel.clothconfig2.impl.builders;
 
 import me.shedaniel.clothconfig2.gui.entries.FloatListListEntry;
 import net.minecraft.client.resource.language.I18n;
+import org.jetbrains.annotations.NotNull;
 
-import javax.annotation.Nonnull;
 import java.util.List;
 import java.util.Optional;
 import java.util.function.Consumer;
@@ -16,7 +16,7 @@ public class FloatListBuilder extends FieldBuilder<List<Float>, FloatListListEnt
     private Consumer<List<Float>> saveConsumer = null;
     private Function<List<Float>, Optional<String[]>> tooltipSupplier = list -> Optional.empty();
     private List<Float> value;
-    private boolean expended = false;
+    private boolean expanded = false;
     private Float min = null, max = null;
     private Function<FloatListListEntry, FloatListListEntry.FloatListCell> createNewInstance;
     private String addTooltip = I18n.translate("text.cloth-config.list.add"), removeTooltip = I18n.translate("text.cloth-config.list.remove");
@@ -71,8 +71,8 @@ public class FloatListBuilder extends FieldBuilder<List<Float>, FloatListListEnt
         return this;
     }
 
-    public FloatListBuilder setExpended(boolean expended) {
-        this.expended = expended;
+    public FloatListBuilder setExpanded(boolean expanded) {
+        this.expanded = expanded;
         return this;
     }
 
@@ -131,7 +131,7 @@ public class FloatListBuilder extends FieldBuilder<List<Float>, FloatListListEnt
         return this;
     }
 
-    @Nonnull
+    @NotNull
     @Override
     public FloatListListEntry build() {
         FloatListListEntry entry = new FloatListListEntry(getFieldNameKey(), value, expended, null, saveConsumer, defaultValue, getResetButtonKey(), isRequireRestart()) {

+ 6 - 4
src/main/java/me/shedaniel/clothconfig2/impl/builders/IntFieldBuilder.java

@@ -1,6 +1,7 @@
 package me.shedaniel.clothconfig2.impl.builders;
 
 import me.shedaniel.clothconfig2.gui.entries.IntegerListEntry;
+import org.jetbrains.annotations.NotNull;
 
 import java.util.Optional;
 import java.util.function.Consumer;
@@ -73,17 +74,18 @@ public class IntFieldBuilder extends FieldBuilder<Integer, IntegerListEntry> {
         this.max = max;
         return this;
     }
-    
+
     public IntFieldBuilder removeMin() {
         this.min = null;
         return this;
     }
-    
+
     public IntFieldBuilder removeMax() {
         this.max = null;
         return this;
     }
-    
+
+    @NotNull
     @Override
     public IntegerListEntry build() {
         IntegerListEntry entry = new IntegerListEntry(getFieldNameKey(), value, getResetButtonKey(), defaultValue, saveConsumer, null, isRequireRestart());
@@ -97,4 +99,4 @@ public class IntFieldBuilder extends FieldBuilder<Integer, IntegerListEntry> {
         return entry;
     }
     
-}
+}

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

@@ -2,8 +2,8 @@ package me.shedaniel.clothconfig2.impl.builders;
 
 import me.shedaniel.clothconfig2.gui.entries.IntegerListListEntry;
 import net.minecraft.client.resource.language.I18n;
+import org.jetbrains.annotations.NotNull;
 
-import javax.annotation.Nonnull;
 import java.util.List;
 import java.util.Optional;
 import java.util.function.Consumer;
@@ -16,7 +16,7 @@ public class IntListBuilder extends FieldBuilder<List<Integer>, IntegerListListE
     private Consumer<List<Integer>> saveConsumer = null;
     private Function<List<Integer>, Optional<String[]>> tooltipSupplier = list -> Optional.empty();
     private List<Integer> value;
-    private boolean expended = false;
+    private boolean expanded = false;
     private Integer min = null, max = null;
     private Function<IntegerListListEntry, IntegerListListEntry.IntegerListCell> createNewInstance;
     private String addTooltip = I18n.translate("text.cloth-config.list.add"), removeTooltip = I18n.translate("text.cloth-config.list.remove");
@@ -71,8 +71,8 @@ public class IntListBuilder extends FieldBuilder<List<Integer>, IntegerListListE
         return this;
     }
 
-    public IntListBuilder setExpended(boolean expended) {
-        this.expended = expended;
+    public IntListBuilder setExpanded(boolean expanded) {
+        this.expanded = expanded;
         return this;
     }
 
@@ -131,10 +131,10 @@ public class IntListBuilder extends FieldBuilder<List<Integer>, IntegerListListE
         return this;
     }
 
-    @Nonnull
+    @NotNull
     @Override
     public IntegerListListEntry build() {
-        IntegerListListEntry entry = new IntegerListListEntry(getFieldNameKey(), value, expended, null, saveConsumer, defaultValue, getResetButtonKey(), isRequireRestart()) {
+        IntegerListListEntry entry = new IntegerListListEntry(getFieldNameKey(), value, expanded, null, saveConsumer, defaultValue, getResetButtonKey(), isRequireRestart()) {
             @Override
             public boolean isDeleteButtonEnabled() {
                 return deleteButtonEnabled;

+ 6 - 4
src/main/java/me/shedaniel/clothconfig2/impl/builders/IntSliderBuilder.java

@@ -1,6 +1,7 @@
 package me.shedaniel.clothconfig2.impl.builders;
 
 import me.shedaniel.clothconfig2.gui.entries.IntegerSliderEntry;
+import org.jetbrains.annotations.NotNull;
 
 import java.util.Optional;
 import java.util.function.Consumer;
@@ -70,17 +71,18 @@ public class IntSliderBuilder extends FieldBuilder<Integer, IntegerSliderEntry>
         this.tooltipSupplier = i -> Optional.ofNullable(tooltip);
         return this;
     }
-    
+
     public IntSliderBuilder setMax(int max) {
         this.max = max;
         return this;
     }
-    
+
     public IntSliderBuilder setMin(int min) {
         this.min = min;
         return this;
     }
-    
+
+    @NotNull
     @Override
     public IntegerSliderEntry build() {
         IntegerSliderEntry entry = new IntegerSliderEntry(getFieldNameKey(), min, max, value, getResetButtonKey(), defaultValue, saveConsumer, null, isRequireRestart());
@@ -92,4 +94,4 @@ public class IntSliderBuilder extends FieldBuilder<Integer, IntegerSliderEntry>
         return entry;
     }
     
-}
+}

+ 22 - 19
src/main/java/me/shedaniel/clothconfig2/impl/builders/KeyCodeBuilder.java

@@ -4,26 +4,28 @@ import me.shedaniel.clothconfig2.api.Modifier;
 import me.shedaniel.clothconfig2.api.ModifierKeyCode;
 import me.shedaniel.clothconfig2.gui.entries.KeyCodeEntry;
 import net.minecraft.client.util.InputUtil;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
 
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
 import java.util.Optional;
 import java.util.function.Consumer;
 import java.util.function.Function;
 import java.util.function.Supplier;
 
 public class KeyCodeBuilder extends FieldBuilder<ModifierKeyCode, KeyCodeEntry> {
-    
-    @Nullable private Consumer<ModifierKeyCode> saveConsumer = null;
-    @Nonnull private Function<ModifierKeyCode, Optional<String[]>> tooltipSupplier = bool -> Optional.empty();
+
+    @Nullable
+    private Consumer<ModifierKeyCode> saveConsumer = null;
+    @NotNull
+    private Function<ModifierKeyCode, Optional<String[]>> tooltipSupplier = bool -> Optional.empty();
     private ModifierKeyCode value;
     private boolean allowKey = true, allowMouse = true, allowModifiers = true;
-    
+
     public KeyCodeBuilder(String resetButtonKey, String fieldNameKey, ModifierKeyCode value) {
         super(resetButtonKey, fieldNameKey);
         this.value = ModifierKeyCode.copyOf(value);
     }
-    
+
     public KeyCodeBuilder setAllowModifiers(boolean allowModifiers) {
         this.allowModifiers = allowModifiers;
         if (!allowModifiers)
@@ -76,40 +78,41 @@ public class KeyCodeBuilder extends FieldBuilder<ModifierKeyCode, KeyCodeEntry>
         this.defaultValue = defaultValue;
         return this;
     }
-    
+
     public KeyCodeBuilder setDefaultValue(InputUtil.KeyCode defaultValue) {
         return setDefaultValue(ModifierKeyCode.of(defaultValue, Modifier.none()));
     }
-    
+
     public KeyCodeBuilder setDefaultValue(ModifierKeyCode defaultValue) {
         this.defaultValue = () -> defaultValue;
         return this;
     }
-    
-    public KeyCodeBuilder setTooltipSupplier(@Nonnull Function<InputUtil.KeyCode, Optional<String[]>> tooltipSupplier) {
+
+    public KeyCodeBuilder setTooltipSupplier(@NotNull Function<InputUtil.KeyCode, Optional<String[]>> tooltipSupplier) {
         return setModifierTooltipSupplier(keyCode -> tooltipSupplier.apply(keyCode.getKeyCode()));
     }
-    
-    public KeyCodeBuilder setModifierTooltipSupplier(@Nonnull Function<ModifierKeyCode, Optional<String[]>> tooltipSupplier) {
+
+    public KeyCodeBuilder setModifierTooltipSupplier(@NotNull Function<ModifierKeyCode, Optional<String[]>> tooltipSupplier) {
         this.tooltipSupplier = tooltipSupplier;
         return this;
     }
-    
-    public KeyCodeBuilder setTooltipSupplier(@Nonnull Supplier<Optional<String[]>> tooltipSupplier) {
+
+    public KeyCodeBuilder setTooltipSupplier(@NotNull Supplier<Optional<String[]>> tooltipSupplier) {
         this.tooltipSupplier = bool -> tooltipSupplier.get();
         return this;
     }
-    
+
     public KeyCodeBuilder setTooltip(Optional<String[]> tooltip) {
         this.tooltipSupplier = bool -> tooltip;
         return this;
     }
-    
+
     public KeyCodeBuilder setTooltip(@Nullable String... tooltip) {
         this.tooltipSupplier = bool -> Optional.ofNullable(tooltip);
         return this;
     }
-    
+
+    @NotNull
     @Override
     public KeyCodeEntry build() {
         KeyCodeEntry entry = new KeyCodeEntry(getFieldNameKey(), value, getResetButtonKey(), defaultValue, saveConsumer, null, isRequireRestart());
@@ -122,4 +125,4 @@ public class KeyCodeBuilder extends FieldBuilder<ModifierKeyCode, KeyCodeEntry>
         return entry;
     }
     
-}
+}

+ 6 - 4
src/main/java/me/shedaniel/clothconfig2/impl/builders/LongFieldBuilder.java

@@ -1,6 +1,7 @@
 package me.shedaniel.clothconfig2.impl.builders;
 
 import me.shedaniel.clothconfig2.gui.entries.LongListEntry;
+import org.jetbrains.annotations.NotNull;
 
 import java.util.Optional;
 import java.util.function.Consumer;
@@ -73,17 +74,18 @@ public class LongFieldBuilder extends FieldBuilder<Long, LongListEntry> {
         this.max = max;
         return this;
     }
-    
+
     public LongFieldBuilder removeMin() {
         this.min = null;
         return this;
     }
-    
+
     public LongFieldBuilder removeMax() {
         this.max = null;
         return this;
     }
-    
+
+    @NotNull
     @Override
     public LongListEntry build() {
         LongListEntry entry = new LongListEntry(getFieldNameKey(), value, getResetButtonKey(), defaultValue, saveConsumer, null, isRequireRestart());
@@ -97,4 +99,4 @@ public class LongFieldBuilder extends FieldBuilder<Long, LongListEntry> {
         return entry;
     }
     
-}
+}

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

@@ -2,8 +2,8 @@ package me.shedaniel.clothconfig2.impl.builders;
 
 import me.shedaniel.clothconfig2.gui.entries.LongListListEntry;
 import net.minecraft.client.resource.language.I18n;
+import org.jetbrains.annotations.NotNull;
 
-import javax.annotation.Nonnull;
 import java.util.List;
 import java.util.Optional;
 import java.util.function.Consumer;
@@ -16,7 +16,7 @@ public class LongListBuilder extends FieldBuilder<List<Long>, LongListListEntry>
     private Consumer<List<Long>> saveConsumer = null;
     private Function<List<Long>, Optional<String[]>> tooltipSupplier = list -> Optional.empty();
     private List<Long> value;
-    private boolean expended = false;
+    private boolean expanded = false;
     private Long min = null, max = null;
     private Function<LongListListEntry, LongListListEntry.LongListCell> createNewInstance;
     private String addTooltip = I18n.translate("text.cloth-config.list.add"), removeTooltip = I18n.translate("text.cloth-config.list.remove");
@@ -60,7 +60,7 @@ public class LongListBuilder extends FieldBuilder<List<Long>, LongListListEntry>
         this.removeTooltip = removeTooltip;
         return this;
     }
-    
+
     public LongListBuilder requireRestart() {
         requireRestart(true);
         return this;
@@ -70,17 +70,17 @@ public class LongListBuilder extends FieldBuilder<List<Long>, LongListListEntry>
         this.createNewInstance = createNewInstance;
         return this;
     }
-    
-    public LongListBuilder setExpended(boolean expended) {
-        this.expended = expended;
+
+    public LongListBuilder setExpanded(boolean expanded) {
+        this.expanded = expanded;
         return this;
     }
-    
+
     public LongListBuilder setSaveConsumer(Consumer<List<Long>> saveConsumer) {
         this.saveConsumer = saveConsumer;
         return this;
     }
-    
+
     public LongListBuilder setDefaultValue(Supplier<List<Long>> defaultValue) {
         this.defaultValue = defaultValue;
         return this;
@@ -120,21 +120,21 @@ public class LongListBuilder extends FieldBuilder<List<Long>, LongListListEntry>
         this.tooltipSupplier = tooltipSupplier;
         return this;
     }
-    
+
     public LongListBuilder setTooltip(Optional<String[]> tooltip) {
         this.tooltipSupplier = list -> tooltip;
         return this;
     }
-    
+
     public LongListBuilder setTooltip(String... tooltip) {
         this.tooltipSupplier = list -> Optional.ofNullable(tooltip);
         return this;
     }
 
-    @Nonnull
+    @NotNull
     @Override
     public LongListListEntry build() {
-        LongListListEntry entry = new LongListListEntry(getFieldNameKey(), value, expended, null, saveConsumer, defaultValue, getResetButtonKey(), isRequireRestart()) {
+        LongListListEntry entry = new LongListListEntry(getFieldNameKey(), value, expanded, null, saveConsumer, defaultValue, getResetButtonKey(), isRequireRestart()) {
             @Override
             public boolean isDeleteButtonEnabled() {
                 return deleteButtonEnabled;

+ 7 - 5
src/main/java/me/shedaniel/clothconfig2/impl/builders/LongSliderBuilder.java

@@ -1,6 +1,7 @@
 package me.shedaniel.clothconfig2.impl.builders;
 
 import me.shedaniel.clothconfig2.gui.entries.LongSliderEntry;
+import org.jetbrains.annotations.NotNull;
 
 import java.util.Optional;
 import java.util.function.Consumer;
@@ -60,18 +61,19 @@ public class LongSliderBuilder extends FieldBuilder<Long, LongSliderEntry> {
         this.tooltipSupplier = i -> tooltipSupplier.get();
         return this;
     }
-    
+
     public LongSliderBuilder setTooltip(Optional<String[]> tooltip) {
         this.tooltipSupplier = i -> tooltip;
         return this;
     }
-    
+
     public LongSliderBuilder setTooltip(String... tooltip) {
         this.tooltipSupplier = i -> Optional.ofNullable(tooltip);
         return this;
     }
-    
-    
+
+
+    @NotNull
     @Override
     public LongSliderEntry build() {
         LongSliderEntry entry = new LongSliderEntry(getFieldNameKey(), min, max, value, saveConsumer, getResetButtonKey(), defaultValue, null, isRequireRestart());
@@ -83,4 +85,4 @@ public class LongSliderBuilder extends FieldBuilder<Long, LongSliderEntry> {
         return entry;
     }
     
-}
+}

+ 6 - 4
src/main/java/me/shedaniel/clothconfig2/impl/builders/SelectorBuilder.java

@@ -1,6 +1,7 @@
 package me.shedaniel.clothconfig2.impl.builders;
 
 import me.shedaniel.clothconfig2.gui.entries.SelectionListEntry;
+import org.jetbrains.annotations.NotNull;
 
 import java.util.Objects;
 import java.util.Optional;
@@ -63,17 +64,18 @@ public class SelectorBuilder<T> extends FieldBuilder<T, SelectionListEntry<T>> {
         this.tooltipSupplier = e -> tooltip;
         return this;
     }
-    
+
     public SelectorBuilder<T> setTooltip(String... tooltip) {
         this.tooltipSupplier = e -> Optional.ofNullable(tooltip);
         return this;
     }
-    
+
     public SelectorBuilder<T> setNameProvider(Function<T, String> enumNameProvider) {
         this.nameProvider = enumNameProvider;
         return this;
     }
-    
+
+    @NotNull
     @Override
     public SelectionListEntry<T> build() {
         SelectionListEntry<T> entry = new SelectionListEntry<>(getFieldNameKey(), valuesArray, value, getResetButtonKey(), defaultValue, saveConsumer, nameProvider, null, isRequireRestart());
@@ -82,5 +84,5 @@ public class SelectorBuilder<T> extends FieldBuilder<T, SelectionListEntry<T>> {
             entry.setErrorSupplier(() -> errorSupplier.apply(entry.getValue()));
         return entry;
     }
-    
+
 }

+ 7 - 5
src/main/java/me/shedaniel/clothconfig2/impl/builders/StringFieldBuilder.java

@@ -1,6 +1,7 @@
 package me.shedaniel.clothconfig2.impl.builders;
 
 import me.shedaniel.clothconfig2.gui.entries.StringListEntry;
+import org.jetbrains.annotations.NotNull;
 
 import java.util.Objects;
 import java.util.Optional;
@@ -54,17 +55,18 @@ public class StringFieldBuilder extends FieldBuilder<String, StringListEntry> {
         this.tooltipSupplier = tooltipSupplier;
         return this;
     }
-    
+
     public StringFieldBuilder setTooltip(Optional<String[]> tooltip) {
         this.tooltipSupplier = str -> tooltip;
         return this;
     }
-    
+
     public StringFieldBuilder setTooltip(String... tooltip) {
         this.tooltipSupplier = str -> Optional.ofNullable(tooltip);
         return this;
     }
-    
+
+    @NotNull
     @Override
     public StringListEntry build() {
         StringListEntry entry = new StringListEntry(getFieldNameKey(), value, getResetButtonKey(), defaultValue, saveConsumer, null, isRequireRestart());
@@ -73,5 +75,5 @@ public class StringFieldBuilder extends FieldBuilder<String, StringListEntry> {
             entry.setErrorSupplier(() -> errorSupplier.apply(entry.getValue()));
         return entry;
     }
-    
-}
+
+}

+ 6 - 4
src/main/java/me/shedaniel/clothconfig2/impl/builders/StringListBuilder.java

@@ -2,6 +2,7 @@ package me.shedaniel.clothconfig2.impl.builders;
 
 import me.shedaniel.clothconfig2.gui.entries.StringListListEntry;
 import net.minecraft.client.resource.language.I18n;
+import org.jetbrains.annotations.NotNull;
 
 import java.util.List;
 import java.util.Optional;
@@ -15,7 +16,7 @@ public class StringListBuilder extends FieldBuilder<List<String>, StringListList
     private Consumer<List<String>> saveConsumer = null;
     private Function<List<String>, Optional<String[]>> tooltipSupplier = list -> Optional.empty();
     private List<String> value;
-    private boolean expended = false;
+    private boolean expanded = false;
     private Function<StringListListEntry, StringListListEntry.StringListCell> createNewInstance;
     private String addTooltip = I18n.translate("text.cloth-config.list.add"), removeTooltip = I18n.translate("text.cloth-config.list.remove");
     private boolean deleteButtonEnabled = true, insertInFront = true;
@@ -69,8 +70,8 @@ public class StringListBuilder extends FieldBuilder<List<String>, StringListList
         return this;
     }
 
-    public StringListBuilder setExpended(boolean expended) {
-        this.expended = expended;
+    public StringListBuilder setExpanded(boolean expanded) {
+        this.expanded = expanded;
         return this;
     }
 
@@ -109,9 +110,10 @@ public class StringListBuilder extends FieldBuilder<List<String>, StringListList
         return this;
     }
 
+    @NotNull
     @Override
     public StringListListEntry build() {
-        StringListListEntry entry = new StringListListEntry(getFieldNameKey(), value, expended, null, saveConsumer, defaultValue, getResetButtonKey(), isRequireRestart());
+        StringListListEntry entry = new StringListListEntry(getFieldNameKey(), value, expanded, null, saveConsumer, defaultValue, getResetButtonKey(), isRequireRestart());
         if (createNewInstance != null)
             entry.setCreateNewInstance(createNewInstance);
         entry.setCellErrorSupplier(cellErrorSupplier);

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

@@ -3,6 +3,7 @@ package me.shedaniel.clothconfig2.impl.builders;
 import com.google.common.collect.Lists;
 import me.shedaniel.clothconfig2.api.AbstractConfigListEntry;
 import me.shedaniel.clothconfig2.gui.entries.SubCategoryListEntry;
+import org.jetbrains.annotations.NotNull;
 
 import java.util.*;
 import java.util.function.Function;
@@ -12,7 +13,7 @@ public class SubCategoryBuilder extends FieldBuilder<Object, SubCategoryListEntr
     
     private List<AbstractConfigListEntry> entries;
     private Function<List<AbstractConfigListEntry>, Optional<String[]>> tooltipSupplier = list -> Optional.empty();
-    private boolean expended = false;
+    private boolean expanded = false;
     
     public SubCategoryBuilder(String resetButtonKey, String fieldNameKey) {
         super(resetButtonKey, fieldNameKey);
@@ -33,29 +34,30 @@ public class SubCategoryBuilder extends FieldBuilder<Object, SubCategoryListEntr
         this.tooltipSupplier = tooltipSupplier;
         return this;
     }
-    
+
     public SubCategoryBuilder setTooltip(Optional<String[]> tooltip) {
         this.tooltipSupplier = list -> tooltip;
         return this;
     }
-    
+
     public SubCategoryBuilder setTooltip(String... tooltip) {
         this.tooltipSupplier = list -> Optional.ofNullable(tooltip);
         return this;
     }
-    
-    public SubCategoryBuilder setExpended(boolean expended) {
-        this.expended = expended;
+
+    public SubCategoryBuilder setExpanded(boolean expanded) {
+        this.expanded = expanded;
         return this;
     }
-    
+
+    @NotNull
     @Override
     public SubCategoryListEntry build() {
-        SubCategoryListEntry entry = new SubCategoryListEntry(getFieldNameKey(), entries, expended);
+        SubCategoryListEntry entry = new SubCategoryListEntry(getFieldNameKey(), entries, expanded);
         entry.setTooltipSupplier(() -> tooltipSupplier.apply(entry.getValue()));
         return entry;
     }
-    
+
     @Override
     public int size() {
         return entries.size();
@@ -171,4 +173,4 @@ public class SubCategoryBuilder extends FieldBuilder<Object, SubCategoryListEntr
         return entries.subList(fromIndex, toIndex);
     }
     
-}
+}

+ 13 - 10
src/main/java/me/shedaniel/clothconfig2/impl/builders/TextDescriptionBuilder.java

@@ -1,22 +1,24 @@
 package me.shedaniel.clothconfig2.impl.builders;
 
 import me.shedaniel.clothconfig2.gui.entries.TextListEntry;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
 
-import javax.annotation.Nullable;
 import java.util.Optional;
 import java.util.function.Supplier;
 
 public class TextDescriptionBuilder extends FieldBuilder<String, TextListEntry> {
-    
+
     private int color = -1;
-    @Nullable private Supplier<Optional<String[]>> tooltipSupplier = null;
+    @Nullable
+    private Supplier<Optional<String[]>> tooltipSupplier = null;
     private String value;
-    
+
     public TextDescriptionBuilder(String resetButtonKey, String fieldNameKey, String value) {
         super(resetButtonKey, fieldNameKey);
         this.value = value;
     }
-    
+
     @Override
     public void requireRestart(boolean requireRestart) {
         throw new UnsupportedOperationException();
@@ -31,20 +33,21 @@ public class TextDescriptionBuilder extends FieldBuilder<String, TextListEntry>
         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;
     }
-    
+
+    @NotNull
     @Override
     public TextListEntry build() {
         return new TextListEntry(getFieldNameKey(), value, color, tooltipSupplier);
     }
-    
-}
+
+}

+ 7 - 5
src/main/java/me/shedaniel/clothconfig2/impl/builders/TextFieldBuilder.java

@@ -1,6 +1,7 @@
 package me.shedaniel.clothconfig2.impl.builders;
 
 import me.shedaniel.clothconfig2.gui.entries.StringListEntry;
+import org.jetbrains.annotations.NotNull;
 
 import java.util.Objects;
 import java.util.Optional;
@@ -54,17 +55,18 @@ public class TextFieldBuilder extends FieldBuilder<String, StringListEntry> {
         this.tooltipSupplier = tooltipSupplier;
         return this;
     }
-    
+
     public TextFieldBuilder setTooltip(Optional<String[]> tooltip) {
         this.tooltipSupplier = str -> tooltip;
         return this;
     }
-    
+
     public TextFieldBuilder setTooltip(String... tooltip) {
         this.tooltipSupplier = str -> Optional.ofNullable(tooltip);
         return this;
     }
-    
+
+    @NotNull
     @Override
     public StringListEntry build() {
         StringListEntry entry = new StringListEntry(getFieldNameKey(), value, getResetButtonKey(), defaultValue, saveConsumer, null, isRequireRestart());
@@ -73,5 +75,5 @@ public class TextFieldBuilder extends FieldBuilder<String, StringListEntry> {
             entry.setErrorSupplier(() -> errorSupplier.apply(entry.getValue()));
         return entry;
     }
-    
-}
+
+}