diff options
| author | MODKILLER1001 | 2022-08-20 09:07:08 -0400 |
|---|---|---|
| committer | MODKILLER1001 | 2022-08-20 09:07:08 -0400 |
| commit | 7e3b12ec23fe25cc900006316a7de586c5d96695 (patch) | |
| tree | e57a9626a92c6b5e8e73b4b0798a7286841b83ef /src/main/java/com | |
| parent | 239c3b83bd84ab23d08a6af104c0198f600e6a5d (diff) | |
modify whitelisted servers
Diffstat (limited to 'src/main/java/com')
| -rw-r--r-- | src/main/java/com/aizistral/nochatreports/config/ModMenuIntegration.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main/java/com/aizistral/nochatreports/config/ModMenuIntegration.java b/src/main/java/com/aizistral/nochatreports/config/ModMenuIntegration.java index 13f4963..364d58b 100644 --- a/src/main/java/com/aizistral/nochatreports/config/ModMenuIntegration.java +++ b/src/main/java/com/aizistral/nochatreports/config/ModMenuIntegration.java @@ -10,6 +10,7 @@ import com.terraformersmc.modmenu.api.ModMenuApi; import me.shedaniel.clothconfig2.api.ConfigBuilder; import me.shedaniel.clothconfig2.api.ConfigCategory; import me.shedaniel.clothconfig2.api.ConfigEntryBuilder; +import me.shedaniel.clothconfig2.gui.entries.StringListListEntry; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import net.minecraft.client.Minecraft; @@ -43,8 +44,7 @@ public class ModMenuIntegration implements ModMenuApi { return tooltip; } - private static final ArrayList<String> DEFAULT_SERVER_ADD = new ArrayList<>(List.of( - "mc.example.com")); + private static final ArrayList<String> DEFAULT_WHITELISTED_SERVERS = new ArrayList<>(List.of()); @Override public ConfigScreenFactory<?> getModConfigScreenFactory() { @@ -159,12 +159,13 @@ public class ModMenuIntegration implements ModMenuApi { // Add or remove whitelisted servers whitelistedServers.addEntry(entryBuilder.startStrList(Component.translatable("option.NoChatReports.whitelistedServers"), NoReportsConfig.getInstance().whitelistedServers) .setExpanded(true) - .setDefaultValue(DEFAULT_SERVER_ADD) .setInsertInFront(true) + .setDefaultValue(DEFAULT_WHITELISTED_SERVERS) .setTooltip(this.makeTooltip("option.NoChatReports.whitelistedServers.tooltip")) .setAddButtonTooltip(Component.translatable("option.NoChatReports.whitelistedServers.addButtonTooltip")) .setRemoveButtonTooltip(Component.translatable("option.NoChatReports.whitelistedServers.removeButtonTooltip")) .setSaveConsumer(newValue -> NoReportsConfig.getInstance().whitelistedServers = newValue) + .setCreateNewInstance(baseListEntry -> new StringListListEntry.StringListCell("Click here to edit server address", (StringListListEntry) baseListEntry)) .build()); // Save config |
