From 3e9a9e97280164c4273bbf16639ab9cb3cc6609b Mon Sep 17 00:00:00 2001 From: MODKILLER1001 Date: Sat, 20 Aug 2022 07:38:46 -0400 Subject: add default server to whitelisted server menu --- .../java/com/aizistral/nochatreports/config/ModMenuIntegration.java | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/main/java/com/aizistral') diff --git a/src/main/java/com/aizistral/nochatreports/config/ModMenuIntegration.java b/src/main/java/com/aizistral/nochatreports/config/ModMenuIntegration.java index b2948c1..13f4963 100644 --- a/src/main/java/com/aizistral/nochatreports/config/ModMenuIntegration.java +++ b/src/main/java/com/aizistral/nochatreports/config/ModMenuIntegration.java @@ -1,5 +1,6 @@ package com.aizistral.nochatreports.config; +import java.util.ArrayList; import java.util.List; import com.aizistral.nochatreports.gui.FontHelper; @@ -42,6 +43,9 @@ public class ModMenuIntegration implements ModMenuApi { return tooltip; } + private static final ArrayList DEFAULT_SERVER_ADD = new ArrayList<>(List.of( + "mc.example.com")); + @Override public ConfigScreenFactory getModConfigScreenFactory() { return screen -> { @@ -155,6 +159,7 @@ 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) .setTooltip(this.makeTooltip("option.NoChatReports.whitelistedServers.tooltip")) .setAddButtonTooltip(Component.translatable("option.NoChatReports.whitelistedServers.addButtonTooltip")) -- cgit v1.2.3