@@ -41,7 +41,7 @@ public class Config {
4141 * spotless:on
4242 */
4343
44- public static void init (File configDir ) {
44+ static synchronized void init (File configDir ) {
4545
4646 // Setup
4747 File configFile = new File (configDir , "defaultserverlist.cfg" );
@@ -98,6 +98,8 @@ public static void init(File configDir) {
9898 // Fetch servers from the specified remote location.
9999 if (useURL ) {
100100 try {
101+ LoadingPlugin .LOGGER .info ("Attempting to load servers from remote location..." );
102+
101103 // servers that are currently at the remote location
102104 Map <String , String > remoteDefaultServers = gson .fromJson (
103105 IOUtils .toString (new URL (url ), StandardCharsets .UTF_8 ),
@@ -106,6 +108,8 @@ public static void init(File configDir) {
106108 private static final long serialVersionUID = -1786059589535074931L ;
107109 }.getType ());
108110
111+ LoadingPlugin .LOGGER .info ("Successfully fetched {} servers from {}" , remoteDefaultServers .size (), url );
112+
109113 if (allowModifications ) {
110114 // servers that were added to the remote location since the last time the list was fetched
111115 Map <String , String > diff = new LinkedHashMap <>();
@@ -168,7 +172,7 @@ private static Map<String, String> toMap(String[] array) {
168172 return map ;
169173 }
170174
171- public static void saveServers (String [] servers ) {
175+ public static synchronized void saveServers (String [] servers ) {
172176 setStringList ("servers" , servers );
173177 config .save ();
174178 }
0 commit comments