Unknown преди 6 години
родител
ревизия
fe521cb8bc
променени са 43 файла, в които са добавени 298 реда и са изтрити 58 реда
  1. 1 1
      gradle.properties
  2. 4 0
      src/main/java/me/shedaniel/clothconfig2/api/AbstractConfigEntry.java
  3. 17 1
      src/main/java/me/shedaniel/clothconfig2/api/AbstractConfigListEntry.java
  4. 2 2
      src/main/java/me/shedaniel/clothconfig2/api/ConfigBuilder.java
  5. 14 1
      src/main/java/me/shedaniel/clothconfig2/gui/ClothConfigScreen.java
  6. 20 0
      src/main/java/me/shedaniel/clothconfig2/gui/ClothRequiresRestartScreen.java
  7. 9 4
      src/main/java/me/shedaniel/clothconfig2/gui/entries/BaseListEntry.java
  8. 8 3
      src/main/java/me/shedaniel/clothconfig2/gui/entries/BooleanListEntry.java
  9. 6 1
      src/main/java/me/shedaniel/clothconfig2/gui/entries/DoubleListEntry.java
  10. 7 2
      src/main/java/me/shedaniel/clothconfig2/gui/entries/DoubleListListEntry.java
  11. 8 3
      src/main/java/me/shedaniel/clothconfig2/gui/entries/EnumListEntry.java
  12. 5 1
      src/main/java/me/shedaniel/clothconfig2/gui/entries/FloatListEntry.java
  13. 7 2
      src/main/java/me/shedaniel/clothconfig2/gui/entries/FloatListListEntry.java
  14. 6 1
      src/main/java/me/shedaniel/clothconfig2/gui/entries/IntegerListEntry.java
  15. 7 2
      src/main/java/me/shedaniel/clothconfig2/gui/entries/IntegerListListEntry.java
  16. 8 3
      src/main/java/me/shedaniel/clothconfig2/gui/entries/IntegerSliderEntry.java
  17. 5 1
      src/main/java/me/shedaniel/clothconfig2/gui/entries/LongListEntry.java
  18. 7 2
      src/main/java/me/shedaniel/clothconfig2/gui/entries/LongListListEntry.java
  19. 8 3
      src/main/java/me/shedaniel/clothconfig2/gui/entries/LongSliderEntry.java
  20. 6 1
      src/main/java/me/shedaniel/clothconfig2/gui/entries/StringListEntry.java
  21. 7 2
      src/main/java/me/shedaniel/clothconfig2/gui/entries/StringListListEntry.java
  22. 13 0
      src/main/java/me/shedaniel/clothconfig2/gui/entries/SubCategoryListEntry.java
  23. 6 2
      src/main/java/me/shedaniel/clothconfig2/gui/entries/TextFieldListEntry.java
  24. 6 1
      src/main/java/me/shedaniel/clothconfig2/gui/entries/TooltipListEntry.java
  25. 1 2
      src/main/java/me/shedaniel/clothconfig2/gui/widget/DynamicEntryListWidget.java
  26. 6 1
      src/main/java/me/shedaniel/clothconfig2/impl/builders/BooleanToggleBuilder.java
  27. 6 1
      src/main/java/me/shedaniel/clothconfig2/impl/builders/DoubleFieldBuilder.java
  28. 6 1
      src/main/java/me/shedaniel/clothconfig2/impl/builders/DoubleListBuilder.java
  29. 6 1
      src/main/java/me/shedaniel/clothconfig2/impl/builders/EnumSelectorBuilder.java
  30. 9 0
      src/main/java/me/shedaniel/clothconfig2/impl/builders/FieldBuilder.java
  31. 6 1
      src/main/java/me/shedaniel/clothconfig2/impl/builders/FloatFieldBuilder.java
  32. 6 1
      src/main/java/me/shedaniel/clothconfig2/impl/builders/FloatListBuilder.java
  33. 6 1
      src/main/java/me/shedaniel/clothconfig2/impl/builders/IntFieldBuilder.java
  34. 6 1
      src/main/java/me/shedaniel/clothconfig2/impl/builders/IntListBuilder.java
  35. 7 2
      src/main/java/me/shedaniel/clothconfig2/impl/builders/IntSliderBuilder.java
  36. 6 1
      src/main/java/me/shedaniel/clothconfig2/impl/builders/LongFieldBuilder.java
  37. 6 1
      src/main/java/me/shedaniel/clothconfig2/impl/builders/LongListBuilder.java
  38. 7 2
      src/main/java/me/shedaniel/clothconfig2/impl/builders/LongSliderBuilder.java
  39. 6 1
      src/main/java/me/shedaniel/clothconfig2/impl/builders/StringListBuilder.java
  40. 5 0
      src/main/java/me/shedaniel/clothconfig2/impl/builders/SubCategoryBuilder.java
  41. 5 0
      src/main/java/me/shedaniel/clothconfig2/impl/builders/TextDescriptionBuilder.java
  42. 6 1
      src/main/java/me/shedaniel/clothconfig2/impl/builders/TextFieldBuilder.java
  43. 5 1
      src/main/resources/assets/cloth-config2/lang/en_us.json

+ 1 - 1
gradle.properties

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

+ 4 - 0
src/main/java/me/shedaniel/clothconfig2/api/AbstractConfigEntry.java

@@ -8,6 +8,10 @@ import java.util.Optional;
 public abstract class AbstractConfigEntry<T> extends DynamicElementListWidget.ElementEntry<AbstractConfigEntry<T>> {
     private ClothConfigScreen screen;
     
+    public abstract boolean isRequiresRestart();
+    
+    public abstract void setRequiresRestart(boolean requiresRestart);
+    
     public abstract String getFieldName();
     
     public abstract T getValue();

+ 17 - 1
src/main/java/me/shedaniel/clothconfig2/api/AbstractConfigListEntry.java

@@ -3,9 +3,25 @@ package me.shedaniel.clothconfig2.api;
 public abstract class AbstractConfigListEntry<T> extends AbstractConfigEntry<T> {
     private String fieldName;
     private boolean editable = true;
+    private boolean requiresRestart;
+    //
+    //    public AbstractConfigListEntry(String fieldName) {
+    //        this(fieldName, false);
+    //    }
     
-    public AbstractConfigListEntry(String fieldName) {
+    public AbstractConfigListEntry(String fieldName, boolean requiresRestart) {
         this.fieldName = fieldName;
+        this.requiresRestart = requiresRestart;
+    }
+    
+    @Override
+    public boolean isRequiresRestart() {
+        return requiresRestart;
+    }
+    
+    @Override
+    public void setRequiresRestart(boolean requiresRestart) {
+        this.requiresRestart = requiresRestart;
     }
     
     public boolean isEditable() {

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

@@ -68,10 +68,10 @@ public interface ConfigBuilder {
     
     Consumer<Screen> getAfterInitConsumer();
     
-    ConfigEntryBuilderImpl getEntryBuilder();
-    
     ConfigBuilder setAfterInitConsumer(Consumer<Screen> afterInitConsumer);
     
+    ConfigEntryBuilderImpl getEntryBuilder();
+    
     Screen build();
     
 }

+ 14 - 1
src/main/java/me/shedaniel/clothconfig2/gui/ClothConfigScreen.java

@@ -51,6 +51,7 @@ public abstract class ClothConfigScreen extends Screen {
     private LinkedHashMap<String, List<AbstractConfigEntry>> tabbedEntries;
     private List<Pair<String, Integer>> tabs;
     private boolean edited;
+    private boolean requiresRestart;
     private boolean confirmSave;
     private AbstractButtonWidget buttonQuit;
     private AbstractButtonWidget buttonSave;
@@ -102,6 +103,7 @@ public abstract class ClothConfigScreen extends Screen {
         this.selectedTabIndex = 0;
         this.confirmSave = confirmSave;
         this.edited = false;
+        this.requiresRestart = false;
         TextRenderer textRenderer = MinecraftClient.getInstance().textRenderer;
         this.tabs = tabbedEntries.keySet().stream().map(s -> new Pair<>(s, textRenderer.getStringWidth(I18n.translate(s)) + 8)).collect(Collectors.toList());
         this.tabsScrollProgress = 0d;
@@ -144,12 +146,20 @@ public abstract class ClothConfigScreen extends Screen {
         return edited;
     }
     
+    @Deprecated
     public void setEdited(boolean edited) {
         this.edited = edited;
         buttonQuit.setMessage(edited ? I18n.translate("text.cloth-config.cancel_discard") : I18n.translate("gui.cancel"));
         buttonSave.active = edited;
     }
     
+    @SuppressWarnings("deprecation")
+    public void setEdited(boolean edited, boolean requiresRestart) {
+        setEdited(edited);
+        if (!this.requiresRestart && requiresRestart)
+            this.requiresRestart = requiresRestart;
+    }
+    
     @Override
     protected void init() {
         super.init();
@@ -180,7 +190,10 @@ public abstract class ClothConfigScreen extends Screen {
                     for(AbstractConfigEntry entry : entries)
                         entry.save();
                 onSave(map);
-                ClothConfigScreen.this.minecraft.openScreen(parent);
+                if (requiresRestart)
+                    ClothConfigScreen.this.minecraft.openScreen(new ClothRequiresRestartScreen(parent));
+                else
+                    ClothConfigScreen.this.minecraft.openScreen(parent);
             }
             
             @Override

+ 20 - 0
src/main/java/me/shedaniel/clothconfig2/gui/ClothRequiresRestartScreen.java

@@ -0,0 +1,20 @@
+package me.shedaniel.clothconfig2.gui;
+
+import net.minecraft.client.MinecraftClient;
+import net.minecraft.client.gui.screen.ConfirmScreen;
+import net.minecraft.client.gui.screen.Screen;
+import net.minecraft.client.resource.language.I18n;
+import net.minecraft.network.chat.TranslatableComponent;
+
+public class ClothRequiresRestartScreen extends ConfirmScreen {
+    
+    public ClothRequiresRestartScreen(Screen parent) {
+        super(t -> {
+            if (t)
+                MinecraftClient.getInstance().scheduleStop();
+            else
+                MinecraftClient.getInstance().openScreen(parent);
+        }, new TranslatableComponent("text.cloth-config.restart_required"), new TranslatableComponent("text.cloth-config.restart_required_sub"), I18n.translate("text.cloth-config.exit_minecraft"), I18n.translate("text.cloth-config.ignore_restart"));
+    }
+    
+}

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

@@ -33,8 +33,13 @@ public abstract class BaseListEntry<T, C extends BaseListCell> extends TooltipLi
     protected Supplier<List<T>> defaultValue;
     protected String addTooltip = I18n.translate("text.cloth-config.list.add"), removeTooltip = I18n.translate("text.cloth-config.list.remove");
     
+    @Deprecated
     public BaseListEntry(String fieldName, Supplier<Optional<String[]>> tooltipSupplier, Supplier<List<T>> defaultValue, Function<BaseListEntry, C> createNewInstance, Consumer<List<T>> saveConsumer, String resetButtonKey) {
-        super(fieldName, tooltipSupplier);
+        this(fieldName, tooltipSupplier, defaultValue, createNewInstance, saveConsumer, resetButtonKey, false);
+    }
+    
+    public BaseListEntry(String fieldName, Supplier<Optional<String[]>> tooltipSupplier, Supplier<List<T>> defaultValue, Function<BaseListEntry, C> createNewInstance, Consumer<List<T>> saveConsumer, String resetButtonKey, boolean requiresRestart) {
+        super(fieldName, tooltipSupplier, requiresRestart);
         this.cells = Lists.newArrayList();
         this.labelWidget = new ListLabelWidget();
         this.widgets = Lists.newArrayList(labelWidget);
@@ -43,7 +48,7 @@ public abstract class BaseListEntry<T, C extends BaseListCell> extends TooltipLi
             cells.clear();
             defaultValue.get().stream().map(this::getFromValue).forEach(cells::add);
             widgets.addAll(cells);
-            getScreen().setEdited(true);
+            getScreen().setEdited(true, isRequiresRestart());
         });
         this.widgets.add(resetWidget);
         this.saveConsumer = saveConsumer;
@@ -189,7 +194,7 @@ public abstract class BaseListEntry<T, C extends BaseListCell> extends TooltipLi
                 C cell;
                 cells.add(0, cell = createNewInstance.apply(BaseListEntry.this));
                 widgets.add(0, cell);
-                getScreen().setEdited(true);
+                getScreen().setEdited(true, isRequiresRestart());
                 MinecraftClient.getInstance().getSoundManager().play(PositionedSoundInstance.master(SoundEvents.UI_BUTTON_CLICK, 1.0F));
                 return true;
             } else if (isInsideDelete(double_1, double_2)) {
@@ -197,7 +202,7 @@ public abstract class BaseListEntry<T, C extends BaseListCell> extends TooltipLi
                 if (focused != null) {
                     cells.remove(focused);
                     widgets.remove(focused);
-                    getScreen().setEdited(true);
+                    getScreen().setEdited(true, isRequiresRestart());
                     MinecraftClient.getInstance().getSoundManager().play(PositionedSoundInstance.master(SoundEvents.UI_BUTTON_CLICK, 1.0F));
                 }
                 return true;

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

@@ -33,16 +33,21 @@ public class BooleanListEntry extends TooltipListEntry<Boolean> {
     
     @Deprecated
     public BooleanListEntry(String fieldName, boolean bool, String resetButtonKey, Supplier<Boolean> defaultValue, Consumer<Boolean> saveConsumer, Supplier<Optional<String[]>> tooltipSupplier) {
-        super(fieldName, tooltipSupplier);
+        this(fieldName, bool, resetButtonKey, defaultValue, saveConsumer, tooltipSupplier, false);
+    }
+    
+    @Deprecated
+    public BooleanListEntry(String fieldName, boolean bool, String resetButtonKey, Supplier<Boolean> defaultValue, Consumer<Boolean> saveConsumer, Supplier<Optional<String[]>> tooltipSupplier, boolean requiresRestart) {
+        super(fieldName, tooltipSupplier, requiresRestart);
         this.defaultValue = defaultValue;
         this.bool = new AtomicBoolean(bool);
         this.buttonWidget = new ButtonWidget(0, 0, 150, 20, "", widget -> {
             BooleanListEntry.this.bool.set(!BooleanListEntry.this.bool.get());
-            getScreen().setEdited(true);
+            getScreen().setEdited(true, isRequiresRestart());
         });
         this.resetButton = new ButtonWidget(0, 0, MinecraftClient.getInstance().textRenderer.getStringWidth(I18n.translate(resetButtonKey)) + 6, 20, I18n.translate(resetButtonKey), widget -> {
             BooleanListEntry.this.bool.set(defaultValue.get());
-            getScreen().setEdited(true);
+            getScreen().setEdited(true, isRequiresRestart());
         });
         this.saveConsumer = saveConsumer;
         this.widgets = Lists.newArrayList(buttonWidget, resetButton);

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

@@ -39,7 +39,12 @@ public class DoubleListEntry extends TextFieldListEntry<Double> {
     
     @Deprecated
     public DoubleListEntry(String fieldName, Double value, String resetButtonKey, Supplier<Double> defaultValue, Consumer<Double> saveConsumer, Supplier<Optional<String[]>> tooltipSupplier) {
-        super(fieldName, value, resetButtonKey, defaultValue, tooltipSupplier);
+        this(fieldName, value, resetButtonKey, defaultValue, saveConsumer, tooltipSupplier, false);
+    }
+    
+    @Deprecated
+    public DoubleListEntry(String fieldName, Double value, String resetButtonKey, Supplier<Double> defaultValue, Consumer<Double> saveConsumer, Supplier<Optional<String[]>> tooltipSupplier, boolean requiresRestart) {
+        super(fieldName, value, resetButtonKey, defaultValue, tooltipSupplier, requiresRestart);
         this.minimum = -Double.MAX_VALUE;
         this.maximum = Double.MAX_VALUE;
         this.saveConsumer = saveConsumer;

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

@@ -19,7 +19,12 @@ public class DoubleListListEntry extends BaseListEntry<Double, DoubleListListEnt
     
     @Deprecated
     public DoubleListListEntry(String fieldName, List<Double> value, boolean defaultExpended, Supplier<Optional<String[]>> tooltipSupplier, Consumer<List<Double>> saveConsumer, Supplier<List<Double>> defaultValue, String resetButtonKey) {
-        super(fieldName, tooltipSupplier, defaultValue, baseListEntry -> new DoubleListCell(0d, (DoubleListListEntry) baseListEntry), saveConsumer, resetButtonKey);
+        this(fieldName, value, defaultExpended, tooltipSupplier, saveConsumer, defaultValue, resetButtonKey, false);
+    }
+    
+    @Deprecated
+    public DoubleListListEntry(String fieldName, List<Double> value, boolean defaultExpended, Supplier<Optional<String[]>> tooltipSupplier, Consumer<List<Double>> saveConsumer, Supplier<List<Double>> defaultValue, String resetButtonKey, boolean requiresRestart) {
+        super(fieldName, tooltipSupplier, defaultValue, baseListEntry -> new DoubleListCell(0d, (DoubleListListEntry) baseListEntry), saveConsumer, resetButtonKey, requiresRestart);
         this.minimum = -Double.MAX_VALUE;
         this.maximum = Double.MAX_VALUE;
         for(Double f : value)
@@ -95,7 +100,7 @@ public class DoubleListListEntry extends BaseListEntry<Double, DoubleListListEnt
             widget.setText(value + "");
             widget.setChangedListener(s -> {
                 if (!(value + "").equalsIgnoreCase(s))
-                    listListEntry.getScreen().setEdited(true);
+                    listListEntry.getScreen().setEdited(true, listListEntry.isRequiresRestart());
             });
         }
         

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

@@ -43,7 +43,12 @@ public class EnumListEntry<T extends Enum<?>> extends TooltipListEntry<T> {
     
     @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, tooltipSupplier);
+        this(fieldName, clazz, value, resetButtonKey, defaultValue, saveConsumer, enumNameProvider, 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, tooltipSupplier, requiresRestart);
         T[] valuesArray = clazz.getEnumConstants();
         if (valuesArray != null)
             this.values = ImmutableList.copyOf(valuesArray);
@@ -55,11 +60,11 @@ public class EnumListEntry<T extends Enum<?>> extends TooltipListEntry<T> {
         this.buttonWidget = new ButtonWidget(0, 0, 150, 20, "", widget -> {
             EnumListEntry.this.index.incrementAndGet();
             EnumListEntry.this.index.compareAndSet(EnumListEntry.this.values.size(), 0);
-            getScreen().setEdited(true);
+            getScreen().setEdited(true, isRequiresRestart());
         });
         this.resetButton = new ButtonWidget(0, 0, MinecraftClient.getInstance().textRenderer.getStringWidth(I18n.translate(resetButtonKey)) + 6, 20, I18n.translate(resetButtonKey), widget -> {
             EnumListEntry.this.index.set(getDefaultIndex());
-            getScreen().setEdited(true);
+            getScreen().setEdited(true, isRequiresRestart());
         });
         this.saveConsumer = saveConsumer;
         this.widgets = Lists.newArrayList(buttonWidget, resetButton);

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

@@ -39,7 +39,11 @@ public class FloatListEntry extends TextFieldListEntry<Float> {
     
     @Deprecated
     public FloatListEntry(String fieldName, Float value, String resetButtonKey, Supplier<Float> defaultValue, Consumer<Float> saveConsumer, Supplier<Optional<String[]>> tooltipSupplier) {
-        super(fieldName, value, resetButtonKey, defaultValue, tooltipSupplier);
+        this(fieldName, value, resetButtonKey, defaultValue, saveConsumer, tooltipSupplier, false);
+    }
+    
+    public FloatListEntry(String fieldName, Float value, String resetButtonKey, Supplier<Float> defaultValue, Consumer<Float> saveConsumer, Supplier<Optional<String[]>> tooltipSupplier, boolean requiresRestart) {
+        super(fieldName, value, resetButtonKey, defaultValue, tooltipSupplier, requiresRestart);
         this.minimum = -Float.MAX_VALUE;
         this.maximum = Float.MAX_VALUE;
         this.saveConsumer = saveConsumer;

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

@@ -19,7 +19,12 @@ public class FloatListListEntry extends BaseListEntry<Float, FloatListListEntry.
     
     @Deprecated
     public FloatListListEntry(String fieldName, List<Float> value, boolean defaultExpended, Supplier<Optional<String[]>> tooltipSupplier, Consumer<List<Float>> saveConsumer, Supplier<List<Float>> defaultValue, String resetButtonKey) {
-        super(fieldName, tooltipSupplier, defaultValue, baseListEntry -> new FloatListCell(0, (FloatListListEntry) baseListEntry), saveConsumer, resetButtonKey);
+        this(fieldName, value, defaultExpended, tooltipSupplier, saveConsumer, defaultValue, resetButtonKey, false);
+    }
+    
+    @Deprecated
+    public FloatListListEntry(String fieldName, List<Float> value, boolean defaultExpended, Supplier<Optional<String[]>> tooltipSupplier, Consumer<List<Float>> saveConsumer, Supplier<List<Float>> defaultValue, String resetButtonKey, boolean requiresRestart) {
+        super(fieldName, tooltipSupplier, defaultValue, baseListEntry -> new FloatListCell(0, (FloatListListEntry) baseListEntry), saveConsumer, resetButtonKey, requiresRestart);
         this.minimum = -Float.MAX_VALUE;
         this.maximum = Float.MAX_VALUE;
         for(float f : value)
@@ -95,7 +100,7 @@ public class FloatListListEntry extends BaseListEntry<Float, FloatListListEntry.
             widget.setText(value + "");
             widget.setChangedListener(s -> {
                 if (!(value + "").equalsIgnoreCase(s))
-                    listListEntry.getScreen().setEdited(true);
+                    listListEntry.getScreen().setEdited(true, listListEntry.isRequiresRestart());
             });
         }
         

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

@@ -39,7 +39,12 @@ public class IntegerListEntry extends TextFieldListEntry<Integer> {
     
     @Deprecated
     public IntegerListEntry(String fieldName, Integer value, String resetButtonKey, Supplier<Integer> defaultValue, Consumer<Integer> saveConsumer, Supplier<Optional<String[]>> tooltipSupplier) {
-        super(fieldName, value, resetButtonKey, defaultValue, tooltipSupplier);
+        this(fieldName, value, resetButtonKey, defaultValue, saveConsumer, tooltipSupplier, false);
+    }
+    
+    @Deprecated
+    public IntegerListEntry(String fieldName, Integer value, String resetButtonKey, Supplier<Integer> defaultValue, Consumer<Integer> saveConsumer, Supplier<Optional<String[]>> tooltipSupplier, boolean requiresRestart) {
+        super(fieldName, value, resetButtonKey, defaultValue, tooltipSupplier, requiresRestart);
         this.minimum = -Integer.MAX_VALUE;
         this.maximum = Integer.MAX_VALUE;
         this.saveConsumer = saveConsumer;

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

@@ -19,7 +19,12 @@ public class IntegerListListEntry extends BaseListEntry<Integer, IntegerListList
     
     @Deprecated
     public IntegerListListEntry(String fieldName, List<Integer> value, boolean defaultExpended, Supplier<Optional<String[]>> tooltipSupplier, Consumer<List<Integer>> saveConsumer, Supplier<List<Integer>> defaultValue, String resetButtonKey) {
-        super(fieldName, tooltipSupplier, defaultValue, baseListEntry -> new IntegerListCell(0, (IntegerListListEntry) baseListEntry), saveConsumer, resetButtonKey);
+        this(fieldName, value, defaultExpended, tooltipSupplier, saveConsumer, defaultValue, resetButtonKey, false);
+    }
+    
+    @Deprecated
+    public IntegerListListEntry(String fieldName, List<Integer> value, boolean defaultExpended, Supplier<Optional<String[]>> tooltipSupplier, Consumer<List<Integer>> saveConsumer, Supplier<List<Integer>> defaultValue, String resetButtonKey, boolean requiresRestart) {
+        super(fieldName, tooltipSupplier, defaultValue, baseListEntry -> new IntegerListCell(0, (IntegerListListEntry) baseListEntry), saveConsumer, resetButtonKey, requiresRestart);
         this.minimum = -Integer.MAX_VALUE;
         this.maximum = Integer.MAX_VALUE;
         for(int integer : value)
@@ -95,7 +100,7 @@ public class IntegerListListEntry extends BaseListEntry<Integer, IntegerListList
             widget.setText(value + "");
             widget.setChangedListener(s -> {
                 if (!(value + "").equalsIgnoreCase(s))
-                    listListEntry.getScreen().setEdited(true);
+                    listListEntry.getScreen().setEdited(true, listListEntry.isRequiresRestart());
             });
         }
         

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

@@ -39,7 +39,12 @@ public class IntegerSliderEntry extends TooltipListEntry<Integer> {
     
     @Deprecated
     public IntegerSliderEntry(String fieldName, int minimum, int maximum, int value, String resetButtonKey, Supplier<Integer> defaultValue, Consumer<Integer> saveConsumer, Supplier<Optional<String[]>> tooltipSupplier) {
-        super(fieldName, tooltipSupplier);
+        this(fieldName, minimum, maximum, value, resetButtonKey, defaultValue, saveConsumer, tooltipSupplier, false);
+    }
+    
+    @Deprecated
+    public IntegerSliderEntry(String fieldName, int minimum, int maximum, int value, String resetButtonKey, Supplier<Integer> defaultValue, Consumer<Integer> saveConsumer, Supplier<Optional<String[]>> tooltipSupplier, boolean requiresRestart) {
+        super(fieldName, tooltipSupplier, requiresRestart);
         this.defaultValue = defaultValue;
         this.value = new AtomicInteger(value);
         this.saveConsumer = saveConsumer;
@@ -50,7 +55,7 @@ public class IntegerSliderEntry extends TooltipListEntry<Integer> {
             sliderWidget.setProgress((MathHelper.clamp(this.defaultValue.get(), minimum, maximum) - minimum) / (double) Math.abs(maximum - minimum));
             this.value.set(MathHelper.clamp(this.defaultValue.get(), minimum, maximum));
             sliderWidget.updateMessage();
-            getScreen().setEdited(true);
+            getScreen().setEdited(true, isRequiresRestart());
         });
         this.sliderWidget.setMessage(textGetter.apply(IntegerSliderEntry.this.value.get()));
         this.widgets = Lists.newArrayList(sliderWidget, resetButton);
@@ -133,7 +138,7 @@ public class IntegerSliderEntry extends TooltipListEntry<Integer> {
         @Override
         protected void applyValue() {
             IntegerSliderEntry.this.value.set((int) (minimum + Math.abs(maximum - minimum) * value));
-            getScreen().setEdited(true);
+            getScreen().setEdited(true, isRequiresRestart());
         }
         
         @Override

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

@@ -39,7 +39,11 @@ public class LongListEntry extends TextFieldListEntry<Long> {
     
     @Deprecated
     public LongListEntry(String fieldName, Long value, String resetButtonKey, Supplier<Long> defaultValue, Consumer<Long> saveConsumer, Supplier<Optional<String[]>> tooltipSupplier) {
-        super(fieldName, value, resetButtonKey, defaultValue, tooltipSupplier);
+        this(fieldName, value, resetButtonKey, defaultValue, saveConsumer, tooltipSupplier, false);
+    }
+    
+    public LongListEntry(String fieldName, Long value, String resetButtonKey, Supplier<Long> defaultValue, Consumer<Long> saveConsumer, Supplier<Optional<String[]>> tooltipSupplier, boolean requiresRestart) {
+        super(fieldName, value, resetButtonKey, defaultValue, tooltipSupplier, requiresRestart);
         this.minimum = -Long.MAX_VALUE;
         this.maximum = Long.MAX_VALUE;
         this.saveConsumer = saveConsumer;

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

@@ -19,7 +19,12 @@ public class LongListListEntry extends BaseListEntry<Long, LongListListEntry.Lon
     
     @Deprecated
     public LongListListEntry(String fieldName, List<Long> value, boolean defaultExpended, Supplier<Optional<String[]>> tooltipSupplier, Consumer<List<Long>> saveConsumer, Supplier<List<Long>> defaultValue, String resetButtonKey) {
-        super(fieldName, tooltipSupplier, defaultValue, baseListEntry -> new LongListCell(0, (LongListListEntry) baseListEntry), saveConsumer, resetButtonKey);
+        this(fieldName, value, defaultExpended, tooltipSupplier, saveConsumer, defaultValue, resetButtonKey, false);
+    }
+    
+    @Deprecated
+    public LongListListEntry(String fieldName, List<Long> value, boolean defaultExpended, Supplier<Optional<String[]>> tooltipSupplier, Consumer<List<Long>> saveConsumer, Supplier<List<Long>> defaultValue, String resetButtonKey, boolean requiresRestart) {
+        super(fieldName, tooltipSupplier, defaultValue, baseListEntry -> new LongListCell(0, (LongListListEntry) baseListEntry), saveConsumer, resetButtonKey, requiresRestart);
         this.minimum = -Long.MAX_VALUE;
         this.maximum = Long.MAX_VALUE;
         for(long l : value)
@@ -95,7 +100,7 @@ public class LongListListEntry extends BaseListEntry<Long, LongListListEntry.Lon
             widget.setText(value + "");
             widget.setChangedListener(s -> {
                 if (!(value + "").equalsIgnoreCase(s))
-                    listListEntry.getScreen().setEdited(true);
+                    listListEntry.getScreen().setEdited(true, listListEntry.isRequiresRestart());
             });
         }
         

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

@@ -39,7 +39,12 @@ public class LongSliderEntry extends TooltipListEntry<Long> {
     
     @Deprecated
     public LongSliderEntry(String fieldName, long minimum, long maximum, long value, Consumer<Long> saveConsumer, String resetButtonKey, Supplier<Long> defaultValue, Supplier<Optional<String[]>> tooltipSupplier) {
-        super(fieldName, tooltipSupplier);
+        this(fieldName, minimum, maximum, value, saveConsumer, resetButtonKey, defaultValue, tooltipSupplier, false);
+    }
+    
+    @Deprecated
+    public LongSliderEntry(String fieldName, long minimum, long maximum, long value, Consumer<Long> saveConsumer, String resetButtonKey, Supplier<Long> defaultValue, Supplier<Optional<String[]>> tooltipSupplier, boolean requiresRestart) {
+        super(fieldName, tooltipSupplier, requiresRestart);
         this.defaultValue = defaultValue;
         this.value = new AtomicLong(value);
         this.saveConsumer = saveConsumer;
@@ -50,7 +55,7 @@ public class LongSliderEntry extends TooltipListEntry<Long> {
             sliderWidget.setValue((MathHelper.clamp(this.defaultValue.get(), minimum, maximum) - minimum) / (double) Math.abs(maximum - minimum));
             this.value.set(Math.min(Math.max(this.defaultValue.get(), minimum), maximum));
             sliderWidget.updateMessage();
-            getScreen().setEdited(true);
+            getScreen().setEdited(true, isRequiresRestart());
         });
         this.sliderWidget.setMessage(textGetter.apply(LongSliderEntry.this.value.get()));
         this.widgets = Lists.newArrayList(sliderWidget, resetButton);
@@ -134,7 +139,7 @@ public class LongSliderEntry extends TooltipListEntry<Long> {
         @Override
         protected void applyValue() {
             LongSliderEntry.this.value.set((long) (minimum + Math.abs(maximum - minimum) * value));
-            getScreen().setEdited(true);
+            getScreen().setEdited(true, isRequiresRestart());
         }
         
         @Override

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

@@ -21,7 +21,12 @@ public class StringListEntry extends TextFieldListEntry<String> {
     
     @Deprecated
     public StringListEntry(String fieldName, String value, String resetButtonKey, Supplier<String> defaultValue, Consumer<String> saveConsumer, Supplier<Optional<String[]>> tooltipSupplier) {
-        super(fieldName, value, resetButtonKey, defaultValue, tooltipSupplier);
+        this(fieldName, value, resetButtonKey, defaultValue, saveConsumer, tooltipSupplier, false);
+    }
+    
+    @Deprecated
+    public StringListEntry(String fieldName, String value, String resetButtonKey, Supplier<String> defaultValue, Consumer<String> saveConsumer, Supplier<Optional<String[]>> tooltipSupplier, boolean requiresRestart) {
+        super(fieldName, value, resetButtonKey, defaultValue, tooltipSupplier, requiresRestart);
         this.saveConsumer = saveConsumer;
     }
     

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

@@ -15,7 +15,12 @@ public class StringListListEntry extends BaseListEntry<String, StringListListEnt
     
     @Deprecated
     public StringListListEntry(String fieldName, List<String> value, boolean defaultExpended, Supplier<Optional<String[]>> tooltipSupplier, Consumer<List<String>> saveConsumer, Supplier<List<String>> defaultValue, String resetButtonKey) {
-        super(fieldName, tooltipSupplier, defaultValue, baseListEntry -> new StringListCell("", (StringListListEntry) baseListEntry), saveConsumer, resetButtonKey);
+        this(fieldName, value, defaultExpended, tooltipSupplier, saveConsumer, defaultValue, resetButtonKey, false);
+    }
+    
+    @Deprecated
+    public StringListListEntry(String fieldName, List<String> value, boolean defaultExpended, Supplier<Optional<String[]>> tooltipSupplier, Consumer<List<String>> saveConsumer, Supplier<List<String>> defaultValue, String resetButtonKey, boolean requiresRestart) {
+        super(fieldName, tooltipSupplier, defaultValue, baseListEntry -> new StringListCell("", (StringListListEntry) baseListEntry), saveConsumer, resetButtonKey, requiresRestart);
         for(String str : value)
             cells.add(new StringListCell(str, this));
         this.widgets.addAll(cells);
@@ -55,7 +60,7 @@ public class StringListListEntry extends BaseListEntry<String, StringListListEnt
             widget.setText(value);
             widget.setChangedListener(s -> {
                 if (!value.contentEquals(s))
-                    listListEntry.getScreen().setEdited(true);
+                    listListEntry.getScreen().setEdited(true, listListEntry.isRequiresRestart());
             });
         }
         

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

@@ -35,6 +35,19 @@ public class SubCategoryListEntry extends TooltipListEntry<List<AbstractConfigLi
         this.children.addAll(entries);
     }
     
+    @Override
+    public boolean isRequiresRestart() {
+        for(AbstractConfigListEntry entry : entries)
+            if (entry.isRequiresRestart())
+                return true;
+        return false;
+    }
+    
+    @Override
+    public void setRequiresRestart(boolean requiresRestart) {
+    
+    }
+    
     public String getCategoryName() {
         return categoryName;
     }

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

@@ -25,6 +25,10 @@ public abstract class TextFieldListEntry<T> extends TooltipListEntry<T> {
     }
     
     protected TextFieldListEntry(String fieldName, T original, String resetButtonKey, Supplier<T> defaultValue, Supplier<Optional<String[]>> tooltipSupplier) {
+        this(fieldName, original, resetButtonKey, defaultValue, tooltipSupplier, false);
+    }
+    
+    protected TextFieldListEntry(String fieldName, T original, String resetButtonKey, Supplier<T> defaultValue, Supplier<Optional<String[]>> tooltipSupplier, boolean requiresRestart) {
         super(fieldName, tooltipSupplier);
         this.defaultValue = defaultValue;
         this.original = original;
@@ -47,11 +51,11 @@ public abstract class TextFieldListEntry<T> extends TooltipListEntry<T> {
         textFieldWidget.setText(String.valueOf(original));
         textFieldWidget.setChangedListener(s -> {
             if (!original.equals(s))
-                getScreen().setEdited(true);
+                getScreen().setEdited(true, isRequiresRestart());
         });
         this.resetButton = new ButtonWidget(0, 0, MinecraftClient.getInstance().textRenderer.getStringWidth(I18n.translate(resetButtonKey)) + 6, 20, I18n.translate(resetButtonKey), widget -> {
             TextFieldListEntry.this.textFieldWidget.setText(String.valueOf(defaultValue.get()));
-            getScreen().setEdited(true);
+            getScreen().setEdited(true, isRequiresRestart());
         });
         this.widgets = Lists.newArrayList(textFieldWidget, resetButton);
     }

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

@@ -11,8 +11,13 @@ public abstract class TooltipListEntry<T> extends AbstractConfigListEntry<T> {
     
     private Supplier<Optional<String[]>> tooltipSupplier;
     
+    @Deprecated
     public TooltipListEntry(String fieldName, Supplier<Optional<String[]>> tooltipSupplier) {
-        super(fieldName);
+        this(fieldName, tooltipSupplier, false);
+    }
+    
+    public TooltipListEntry(String fieldName, Supplier<Optional<String[]>> tooltipSupplier, boolean requiresRestart) {
+        super(fieldName, requiresRestart);
         this.tooltipSupplier = tooltipSupplier;
     }
     

+ 1 - 2
src/main/java/me/shedaniel/clothconfig2/gui/widget/DynamicEntryListWidget.java

@@ -457,8 +457,7 @@ public abstract class DynamicEntryListWidget<E extends DynamicEntryListWidget.En
     
     @Environment(EnvType.CLIENT)
     public abstract static class Entry<E extends Entry<E>> extends DrawableHelper implements Element {
-        @Deprecated
-        DynamicEntryListWidget<E> parent;
+        @Deprecated DynamicEntryListWidget<E> parent;
         
         public Entry() {
         }

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

@@ -20,6 +20,11 @@ public class BooleanToggleBuilder extends FieldBuilder<Boolean, BooleanListEntry
         this.value = value;
     }
     
+    public BooleanToggleBuilder requireRestart() {
+        requireRestart(true);
+        return this;
+    }
+    
     public BooleanToggleBuilder setSaveConsumer(Consumer<Boolean> saveConsumer) {
         this.saveConsumer = saveConsumer;
         return this;
@@ -58,7 +63,7 @@ public class BooleanToggleBuilder extends FieldBuilder<Boolean, BooleanListEntry
     
     @Override
     public BooleanListEntry build() {
-        return new BooleanListEntry(getFieldNameKey(), value, getResetButtonKey(), defaultValue, saveConsumer, tooltipSupplier) {
+        return new BooleanListEntry(getFieldNameKey(), value, getResetButtonKey(), defaultValue, saveConsumer, tooltipSupplier, isRequireRestart()) {
             @Override
             public String getYesNoText(boolean bool) {
                 return yesNoTextSupplier.apply(bool);

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

@@ -18,6 +18,11 @@ public class DoubleFieldBuilder extends FieldBuilder<Double, DoubleListEntry> {
         this.value = value;
     }
     
+    public DoubleFieldBuilder requireRestart() {
+        requireRestart(true);
+        return this;
+    }
+    
     public DoubleFieldBuilder setSaveConsumer(Consumer<Double> saveConsumer) {
         this.saveConsumer = saveConsumer;
         return this;
@@ -70,7 +75,7 @@ public class DoubleFieldBuilder extends FieldBuilder<Double, DoubleListEntry> {
     
     @Override
     public DoubleListEntry build() {
-        DoubleListEntry entry = new DoubleListEntry(getFieldNameKey(), value, getResetButtonKey(), defaultValue, saveConsumer, tooltipSupplier);
+        DoubleListEntry entry = new DoubleListEntry(getFieldNameKey(), value, getResetButtonKey(), defaultValue, saveConsumer, tooltipSupplier, isRequireRestart());
         if (min != null)
             entry.setMinimum(min);
         if (max != null)

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

@@ -23,6 +23,11 @@ public class DoubleListBuilder extends FieldBuilder<List<Double>, DoubleListList
         this.value = value;
     }
     
+    public DoubleListBuilder requireRestart() {
+        requireRestart(true);
+        return this;
+    }
+    
     public DoubleListBuilder setCreateNewInstance(Function<BaseListEntry, DoubleListListEntry.DoubleListCell> createNewInstance) {
         this.createNewInstance = createNewInstance;
         return this;
@@ -85,7 +90,7 @@ public class DoubleListBuilder extends FieldBuilder<List<Double>, DoubleListList
     
     @Override
     public DoubleListListEntry build() {
-        DoubleListListEntry entry = new DoubleListListEntry(getFieldNameKey(), value, expended, tooltipSupplier, saveConsumer, defaultValue, getResetButtonKey());
+        DoubleListListEntry entry = new DoubleListListEntry(getFieldNameKey(), value, expended, tooltipSupplier, saveConsumer, defaultValue, getResetButtonKey(), isRequireRestart());
         if (min != null)
             entry.setMinimum(min);
         if (max != null)

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

@@ -24,6 +24,11 @@ public class EnumSelectorBuilder<T extends Enum<?>> extends FieldBuilder<T, Enum
         this.clazz = clazz;
     }
     
+    public EnumSelectorBuilder<T> requireRestart() {
+        requireRestart(true);
+        return this;
+    }
+    
     public EnumSelectorBuilder setSaveConsumer(Consumer<T> saveConsumer) {
         this.saveConsumer = saveConsumer;
         return this;
@@ -63,7 +68,7 @@ public class EnumSelectorBuilder<T extends Enum<?>> extends FieldBuilder<T, Enum
     
     @Override
     public EnumListEntry<T> build() {
-        return new EnumListEntry<T>(getFieldNameKey(), clazz, value, getResetButtonKey(), defaultValue, saveConsumer, enumNameProvider, tooltipSupplier);
+        return new EnumListEntry<T>(getFieldNameKey(), clazz, value, getResetButtonKey(), defaultValue, saveConsumer, enumNameProvider, tooltipSupplier, isRequireRestart());
     }
     
 }

+ 9 - 0
src/main/java/me/shedaniel/clothconfig2/impl/builders/FieldBuilder.java

@@ -7,6 +7,7 @@ import java.util.function.Supplier;
 public abstract class FieldBuilder<T, A extends AbstractConfigListEntry> {
     private final String fieldNameKey;
     private final String resetButtonKey;
+    protected boolean requireRestart = false;
     protected Supplier<T> defaultValue = null;
     
     protected FieldBuilder(String resetButtonKey, String fieldNameKey) {
@@ -32,4 +33,12 @@ public abstract class FieldBuilder<T, A extends AbstractConfigListEntry> {
         return resetButtonKey;
     }
     
+    public boolean isRequireRestart() {
+        return requireRestart;
+    }
+    
+    public void requireRestart(boolean requireRestart) {
+        this.requireRestart = requireRestart;
+    }
+    
 }

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

@@ -18,6 +18,11 @@ public class FloatFieldBuilder extends FieldBuilder<Float, FloatListEntry> {
         this.value = value;
     }
     
+    public FloatFieldBuilder requireRestart() {
+        requireRestart(true);
+        return this;
+    }
+    
     public FloatFieldBuilder setSaveConsumer(Consumer<Float> saveConsumer) {
         this.saveConsumer = saveConsumer;
         return this;
@@ -70,7 +75,7 @@ public class FloatFieldBuilder extends FieldBuilder<Float, FloatListEntry> {
     
     @Override
     public FloatListEntry build() {
-        FloatListEntry entry = new FloatListEntry(getFieldNameKey(), value, getResetButtonKey(), defaultValue, saveConsumer, tooltipSupplier);
+        FloatListEntry entry = new FloatListEntry(getFieldNameKey(), value, getResetButtonKey(), defaultValue, saveConsumer, tooltipSupplier, isRequireRestart());
         if (min != null)
             entry.setMinimum(min);
         if (max != null)

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

@@ -23,6 +23,11 @@ public class FloatListBuilder extends FieldBuilder<List<Float>, FloatListListEnt
         this.value = value;
     }
     
+    public FloatListBuilder requireRestart() {
+        requireRestart(true);
+        return this;
+    }
+    
     public FloatListBuilder setCreateNewInstance(Function<BaseListEntry, FloatListListEntry.FloatListCell> createNewInstance) {
         this.createNewInstance = createNewInstance;
         return this;
@@ -85,7 +90,7 @@ public class FloatListBuilder extends FieldBuilder<List<Float>, FloatListListEnt
     
     @Override
     public FloatListListEntry build() {
-        FloatListListEntry entry = new FloatListListEntry(getFieldNameKey(), value, expended, tooltipSupplier, saveConsumer, defaultValue, getResetButtonKey());
+        FloatListListEntry entry = new FloatListListEntry(getFieldNameKey(), value, expended, tooltipSupplier, saveConsumer, defaultValue, getResetButtonKey(), isRequireRestart());
         if (min != null)
             entry.setMinimum(min);
         if (max != null)

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

@@ -18,6 +18,11 @@ public class IntFieldBuilder extends FieldBuilder<Integer, IntegerListEntry> {
         this.value = value;
     }
     
+    public IntFieldBuilder requireRestart() {
+        requireRestart(true);
+        return this;
+    }
+    
     public IntFieldBuilder setSaveConsumer(Consumer<Integer> saveConsumer) {
         this.saveConsumer = saveConsumer;
         return this;
@@ -70,7 +75,7 @@ public class IntFieldBuilder extends FieldBuilder<Integer, IntegerListEntry> {
     
     @Override
     public IntegerListEntry build() {
-        IntegerListEntry entry = new IntegerListEntry(getFieldNameKey(), value, getResetButtonKey(), defaultValue, saveConsumer, tooltipSupplier);
+        IntegerListEntry entry = new IntegerListEntry(getFieldNameKey(), value, getResetButtonKey(), defaultValue, saveConsumer, tooltipSupplier, isRequireRestart());
         if (min != null)
             entry.setMinimum(min);
         if (max != null)

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

@@ -23,6 +23,11 @@ public class IntListBuilder extends FieldBuilder<List<Integer>, IntegerListListE
         this.value = value;
     }
     
+    public IntListBuilder requireRestart() {
+        requireRestart(true);
+        return this;
+    }
+    
     public IntListBuilder setCreateNewInstance(Function<BaseListEntry, IntegerListListEntry.IntegerListCell> createNewInstance) {
         this.createNewInstance = createNewInstance;
         return this;
@@ -85,7 +90,7 @@ public class IntListBuilder extends FieldBuilder<List<Integer>, IntegerListListE
     
     @Override
     public IntegerListListEntry build() {
-        IntegerListListEntry entry = new IntegerListListEntry(getFieldNameKey(), value, expended, tooltipSupplier, saveConsumer, defaultValue, getResetButtonKey());
+        IntegerListListEntry entry = new IntegerListListEntry(getFieldNameKey(), value, expended, tooltipSupplier, saveConsumer, defaultValue, getResetButtonKey(), isRequireRestart());
         if (min != null)
             entry.setMinimum(min);
         if (max != null)

+ 7 - 2
src/main/java/me/shedaniel/clothconfig2/impl/builders/IntSliderBuilder.java

@@ -21,6 +21,11 @@ public class IntSliderBuilder extends FieldBuilder<Integer, IntegerSliderEntry>
         this.min = min;
     }
     
+    public IntSliderBuilder requireRestart() {
+        requireRestart(true);
+        return this;
+    }
+    
     public IntSliderBuilder setTextGetter(Function<Integer, String> textGetter) {
         this.textGetter = textGetter;
         return this;
@@ -69,8 +74,8 @@ public class IntSliderBuilder extends FieldBuilder<Integer, IntegerSliderEntry>
     @Override
     public IntegerSliderEntry build() {
         if (textGetter == null)
-            return new IntegerSliderEntry(getFieldNameKey(), min, max, value, getResetButtonKey(), defaultValue, saveConsumer, tooltipSupplier);
-        return new IntegerSliderEntry(getFieldNameKey(), min, max, value, getResetButtonKey(), defaultValue, saveConsumer, tooltipSupplier).setTextGetter(textGetter);
+            return new IntegerSliderEntry(getFieldNameKey(), min, max, value, getResetButtonKey(), defaultValue, saveConsumer, tooltipSupplier, isRequireRestart());
+        return new IntegerSliderEntry(getFieldNameKey(), min, max, value, getResetButtonKey(), defaultValue, saveConsumer, tooltipSupplier, isRequireRestart()).setTextGetter(textGetter);
     }
     
 }

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

@@ -18,6 +18,11 @@ public class LongFieldBuilder extends FieldBuilder<Long, LongListEntry> {
         this.value = value;
     }
     
+    public LongFieldBuilder requireRestart() {
+        requireRestart(true);
+        return this;
+    }
+    
     public LongFieldBuilder setSaveConsumer(Consumer<Long> saveConsumer) {
         this.saveConsumer = saveConsumer;
         return this;
@@ -70,7 +75,7 @@ public class LongFieldBuilder extends FieldBuilder<Long, LongListEntry> {
     
     @Override
     public LongListEntry build() {
-        LongListEntry entry = new LongListEntry(getFieldNameKey(), value, getResetButtonKey(), defaultValue, saveConsumer, tooltipSupplier);
+        LongListEntry entry = new LongListEntry(getFieldNameKey(), value, getResetButtonKey(), defaultValue, saveConsumer, tooltipSupplier, isRequireRestart());
         if (min != null)
             entry.setMinimum(min);
         if (max != null)

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

@@ -23,6 +23,11 @@ public class LongListBuilder extends FieldBuilder<List<Long>, LongListListEntry>
         this.value = value;
     }
     
+    public LongListBuilder requireRestart() {
+        requireRestart(true);
+        return this;
+    }
+    
     public LongListBuilder setCreateNewInstance(Function<BaseListEntry, LongListListEntry.LongListCell> createNewInstance) {
         this.createNewInstance = createNewInstance;
         return this;
@@ -85,7 +90,7 @@ public class LongListBuilder extends FieldBuilder<List<Long>, LongListListEntry>
     
     @Override
     public LongListListEntry build() {
-        LongListListEntry entry = new LongListListEntry(getFieldNameKey(), value, expended, tooltipSupplier, saveConsumer, defaultValue, getResetButtonKey());
+        LongListListEntry entry = new LongListListEntry(getFieldNameKey(), value, expended, tooltipSupplier, saveConsumer, defaultValue, getResetButtonKey(), isRequireRestart());
         if (min != null)
             entry.setMinimum(min);
         if (max != null)

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

@@ -21,6 +21,11 @@ public class LongSliderBuilder extends FieldBuilder<Long, LongSliderEntry> {
         this.min = min;
     }
     
+    public LongSliderBuilder requireRestart() {
+        requireRestart(true);
+        return this;
+    }
+    
     public LongSliderBuilder setTextGetter(Function<Long, String> textGetter) {
         this.textGetter = textGetter;
         return this;
@@ -59,8 +64,8 @@ public class LongSliderBuilder extends FieldBuilder<Long, LongSliderEntry> {
     @Override
     public LongSliderEntry build() {
         if (textGetter == null)
-            return new LongSliderEntry(getFieldNameKey(), min, max, value, saveConsumer, getResetButtonKey(), defaultValue, tooltipSupplier);
-        return new LongSliderEntry(getFieldNameKey(), min, max, value, saveConsumer, getResetButtonKey(), defaultValue, tooltipSupplier).setTextGetter(textGetter);
+            return new LongSliderEntry(getFieldNameKey(), min, max, value, saveConsumer, getResetButtonKey(), defaultValue, tooltipSupplier, isRequireRestart());
+        return new LongSliderEntry(getFieldNameKey(), min, max, value, saveConsumer, getResetButtonKey(), defaultValue, tooltipSupplier, isRequireRestart()).setTextGetter(textGetter);
     }
     
 }

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

@@ -22,6 +22,11 @@ public class StringListBuilder extends FieldBuilder<List<String>, StringListList
         this.value = value;
     }
     
+    public StringListBuilder requireRestart() {
+        requireRestart(true);
+        return this;
+    }
+    
     public StringListBuilder setCreateNewInstance(Function<BaseListEntry, StringListListEntry.StringListCell> createNewInstance) {
         this.createNewInstance = createNewInstance;
         return this;
@@ -64,7 +69,7 @@ public class StringListBuilder extends FieldBuilder<List<String>, StringListList
     
     @Override
     public StringListListEntry build() {
-        StringListListEntry entry = new StringListListEntry(getFieldNameKey(), value, expended, tooltipSupplier, saveConsumer, defaultValue, getResetButtonKey());
+        StringListListEntry entry = new StringListListEntry(getFieldNameKey(), value, expended, tooltipSupplier, saveConsumer, defaultValue, getResetButtonKey(), isRequireRestart());
         if (createNewInstance != null)
             entry.setCreateNewInstance(createNewInstance);
         return entry;

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

@@ -18,6 +18,11 @@ public class SubCategoryBuilder extends FieldBuilder<Object, SubCategoryListEntr
         this.entries = Lists.newArrayList();
     }
     
+    @Override
+    public void requireRestart(boolean requireRestart) {
+        throw new UnsupportedOperationException();
+    }
+    
     public SubCategoryBuilder setTooltipSupplier(Supplier<Optional<String[]>> tooltipSupplier) {
         this.tooltipSupplier = tooltipSupplier;
         return this;

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

@@ -16,6 +16,11 @@ public class TextDescriptionBuilder extends FieldBuilder<String, TextListEntry>
         this.value = value;
     }
     
+    @Override
+    public void requireRestart(boolean requireRestart) {
+        throw new UnsupportedOperationException();
+    }
+    
     public TextDescriptionBuilder setTooltipSupplier(Supplier<Optional<String[]>> tooltipSupplier) {
         this.tooltipSupplier = tooltipSupplier;
         return this;

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

@@ -19,6 +19,11 @@ public class TextFieldBuilder extends FieldBuilder<String, StringListEntry> {
         this.value = value;
     }
     
+    public TextFieldBuilder requireRestart() {
+        requireRestart(true);
+        return this;
+    }
+    
     public TextFieldBuilder setSaveConsumer(Consumer<String> saveConsumer) {
         this.saveConsumer = saveConsumer;
         return this;
@@ -51,7 +56,7 @@ public class TextFieldBuilder extends FieldBuilder<String, StringListEntry> {
     
     @Override
     public StringListEntry build() {
-        return new StringListEntry(getFieldNameKey(), value, getResetButtonKey(), defaultValue, saveConsumer, tooltipSupplier);
+        return new StringListEntry(getFieldNameKey(), value, getResetButtonKey(), defaultValue, saveConsumer, tooltipSupplier, isRequireRestart());
     }
     
 }

+ 5 - 1
src/main/resources/assets/cloth-config2/lang/en_us.json

@@ -17,5 +17,9 @@
   "text.cloth-config.list.remove": "Delete Selected",
   "text.cloth-config.error_cannot_save": "Error!",
   "text.cloth-config.reset_value": "Reset",
-  "text.cloth.reset_value": "Reset"
+  "text.cloth.reset_value": "Reset",
+  "text.cloth-config.restart_required": "Restart Required",
+  "text.cloth-config.restart_required_sub": "One of your modified settings requires Minecraft to be restarted. Do you want to proceed?",
+  "text.cloth-config.exit_minecraft": "Exit Minecraft",
+  "text.cloth-config.ignore_restart": "Ignore Restart"
 }