summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/main/java/com/aizistral/nochatreports/config/JSONConfig.java2
-rw-r--r--src/main/java/com/aizistral/nochatreports/config/NCRClientConfig.java5
-rw-r--r--src/main/java/com/aizistral/nochatreports/config/NCRCommonConfig.java5
3 files changed, 12 insertions, 0 deletions
diff --git a/src/main/java/com/aizistral/nochatreports/config/JSONConfig.java b/src/main/java/com/aizistral/nochatreports/config/JSONConfig.java
index 69f3ef3..3369439 100644
--- a/src/main/java/com/aizistral/nochatreports/config/JSONConfig.java
+++ b/src/main/java/com/aizistral/nochatreports/config/JSONConfig.java
@@ -52,6 +52,8 @@ public abstract class JSONConfig {
// NO-OP
}
+ public abstract JSONConfig getDefault();
+
public static <T extends JSONConfig> T loadConfig(Class<T> configClass, Supplier<T> freshInstance, String fileName) {
NoChatReports.LOGGER.info("Reading config file {}...", fileName);
T config = readFile(fileName, configClass).orElseGet(freshInstance);
diff --git a/src/main/java/com/aizistral/nochatreports/config/NCRClientConfig.java b/src/main/java/com/aizistral/nochatreports/config/NCRClientConfig.java
index 0ab4db9..a07c92d 100644
--- a/src/main/java/com/aizistral/nochatreports/config/NCRClientConfig.java
+++ b/src/main/java/com/aizistral/nochatreports/config/NCRClientConfig.java
@@ -25,6 +25,11 @@ public final class NCRClientConfig extends JSONConfig {
super(FILE_NAME);
}
+ @Override
+ public NCRClientConfig getDefault() {
+ return new NCRClientConfig();
+ }
+
/**
* @return True if client with No Chat Reports installed should demand that mod is present on
* every server that it tries to join. In that case client will not be able to join servers that
diff --git a/src/main/java/com/aizistral/nochatreports/config/NCRCommonConfig.java b/src/main/java/com/aizistral/nochatreports/config/NCRCommonConfig.java
index 65bbfc6..509100f 100644
--- a/src/main/java/com/aizistral/nochatreports/config/NCRCommonConfig.java
+++ b/src/main/java/com/aizistral/nochatreports/config/NCRCommonConfig.java
@@ -17,6 +17,11 @@ public final class NCRCommonConfig extends JSONConfig {
super(FILE_NAME);
}
+ @Override
+ public NCRCommonConfig getDefault() {
+ return new NCRCommonConfig();
+ }
+
/**
* @return True if server with No Chat Reports installed should demand that mod is present on
* every client that tries to join. Mod's installation on client is optional otherwise.<br><br>