Skip to content

Commit

Permalink
REALLY FUCKING FIXED
Browse files Browse the repository at this point in the history
  • Loading branch information
Yoghurt4C committed Jun 15, 2021
1 parent 885b9b3 commit d8d8806
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ loader_version=0.11.3

fabric_version=0.35.0+1.17

mod_version = 1.1.11
mod_version = 1.1.12
archives_base_name = LilTaterReloaded

mod_menu_version=2.0.2
Expand Down
21 changes: 16 additions & 5 deletions src/main/java/mods/ltr/config/LilTaterReloadedConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import java.io.IOException;
import java.lang.ref.WeakReference;
import java.nio.file.Path;
import java.util.Arrays;
import java.util.Date;
import java.util.Map;
import java.util.Properties;
Expand Down Expand Up @@ -59,14 +60,24 @@ public static void init() {
);

boolean changed = false;
Path path = FabricLoader.getInstance().getConfigDir().resolve("powertaters/liltaterreloaded/ltr.properties");
File configurationFile = path.toFile();
Path path = FabricLoader.getInstance().getConfigDir().resolve("powertaters/liltaterreloaded");
File dir = path.toFile();
File configurationFile = path.resolve("ltr.properties").toFile();
try {
if (!configurationFile.exists() && !configurationFile.createNewFile()) {
LOGGER.error("[LTR] Could not create configuration file: " + configurationFile.getAbsolutePath());
if (!configurationFile.exists() && dir.mkdirs() && configurationFile.createNewFile()) {
LOGGER.info("[LTR] Successfully created the configuration file.");
}
} catch (IOException e) {
LOGGER.error("[LTR] Error while writing configuration file: " + e);
LOGGER.error("[LTR] Could not create configuration file: " + configurationFile.getAbsolutePath() + ". Something might be up with write permissions. Using default values internally!");
// in case of failure, use default values. don't write because there's no file
for (LTRConfigEntry<?> entry : entries) {
cfg.put(entry.key, entry.value.toString());
}
ltrConfig = new LTRConfig(cfg);
return;
} finally {
isInitialized = true;

}

DebugTimer.INSTANCE = new DebugTimer();
Expand Down

0 comments on commit d8d8806

Please sign in to comment.