Code style fix & version update
This commit is contained in:
parent
6266b30088
commit
179ada3296
20 changed files with 392 additions and 427 deletions
|
@ -1,14 +1,13 @@
|
|||
package ru.bclib.config;
|
||||
|
||||
import java.io.File;
|
||||
import java.nio.file.Path;
|
||||
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
|
||||
import net.fabricmc.loader.api.FabricLoader;
|
||||
import ru.bclib.util.JsonFactory;
|
||||
|
||||
import java.io.File;
|
||||
import java.nio.file.Path;
|
||||
|
||||
public class ConfigWriter {
|
||||
private final static Path GAME_CONFIG_DIR = FabricLoader.getInstance().getConfigDir();
|
||||
|
||||
|
@ -18,14 +17,9 @@ public class ConfigWriter {
|
|||
public ConfigWriter(String modID, String configFile) {
|
||||
this(modID, configFile, null);
|
||||
}
|
||||
|
||||
|
||||
public ConfigWriter(String modID, String configFile, File configFolder) {
|
||||
this.configFile = new File(
|
||||
(configFolder==null
|
||||
? GAME_CONFIG_DIR.resolve(modID).toFile()
|
||||
: new File(configFolder, modID)),
|
||||
configFile + ".json"
|
||||
);
|
||||
this.configFile = new File((configFolder == null ? GAME_CONFIG_DIR.resolve(modID).toFile() : new File(configFolder, modID)), configFile + ".json");
|
||||
File parent = this.configFile.getParentFile();
|
||||
if (!parent.exists()) {
|
||||
parent.mkdirs();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue