Selaa lähdekoodia

Remove save on exit feature

Lortseam 4 vuotta sitten
vanhempi
sitoutus
4cd5854a4a
1 muutettua tiedostoa jossa 3 lisäystä ja 19 poistoa
  1. 3 19
      lib/src/main/java/me/lortseam/completeconfig/data/Config.java

+ 3 - 19
lib/src/main/java/me/lortseam/completeconfig/data/Config.java

@@ -46,24 +46,19 @@ public class Config extends BaseCollection {
      *
      * @param modId the ID of the mod creating the config
      * @param branch the branch
-     * @param saveOnExit whether to save the config when the client or server stops
      */
-    public Config(String modId, String[] branch, boolean saveOnExit) {
+    public Config(String modId, String[] branch) {
         source = new ConfigSource(modId, branch);
         ConfigRegistry.register(this);
-        if (saveOnExit) {
-            Runtime.getRuntime().addShutdownHook(new Thread(this::save));
-        }
     }
 
     /**
      * Creates a config with the default branch.
      *
      * @param modId the ID of the mod creating the config
-     * @param saveOnExit whether to save the config when the client or server stops
      */
-    public Config(String modId, boolean saveOnExit) {
-        this(modId, new String[0], saveOnExit);
+    public Config(String modId) {
+        this(modId, new String[0]);
     }
 
     public ModMetadata getMod() {
@@ -168,17 +163,6 @@ public class Config extends BaseCollection {
             return this;
         }
 
-        /**
-         * Sets a flag to save the config when the game closes.
-         *
-         * @return this builder
-         */
-        @Deprecated
-        public Builder saveOnExit() {
-            saveOnExit = true;
-            return this;
-        }
-
         /**
          * Registers the config as main mod config.
          *