Skip to content

Commit 4272a1e

Browse files
committed
Revert "fix subconfigs dying"
This reverts commit a0fbe9a.
1 parent a0fbe9a commit 4272a1e

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

src/main/java/cc/polyfrost/oneconfig/config/Config.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -154,12 +154,6 @@ public void reInitialize() {
154154
* Save current config to file
155155
*/
156156
public void save() {
157-
if (this instanceof cc.polyfrost.oneconfig.config.elements.SubConfig) {
158-
Mod mod = ConfigCore.getParentMod(this.mod);
159-
if (mod == null) return;
160-
mod.config.save();
161-
return;
162-
}
163157
logger.trace("Saving config for {}...", mod.name);
164158

165159
Path profilePath = ConfigUtils.getProfileFile(configFile).toPath();

src/main/java/cc/polyfrost/oneconfig/internal/config/core/ConfigCore.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,4 +75,14 @@ public static Mod getParentMod(Mod mod) {
7575
}
7676
return null;
7777
}
78+
79+
static {
80+
Executors.newSingleThreadScheduledExecutor()
81+
.scheduleAtFixedRate(
82+
ConfigCore::saveAll,
83+
0,
84+
60,
85+
TimeUnit.SECONDS
86+
);
87+
}
7888
}

0 commit comments

Comments
 (0)