File tree Expand file tree Collapse file tree
src/main/java/net/vulkanmod/config Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -31,8 +31,7 @@ public class Config {
3131 public boolean textureAnimations = true ;
3232
3333 public void write () {
34-
35- if (!Files .exists (CONFIG_PATH .getParent ())) {
34+ if (!Files .exists (CONFIG_PATH .getParent ())) {
3635 try {
3736 Files .createDirectories (CONFIG_PATH );
3837 } catch (IOException e ) {
@@ -61,13 +60,13 @@ public static Config load(Path path) {
6160 if (Files .exists (path )) {
6261 try (FileReader fileReader = new FileReader (path .toFile ())) {
6362 config = GSON .fromJson (fileReader , Config .class );
64- }
65- catch (IOException exception ) {
63+ } catch (IOException exception ) {
6664 throw new RuntimeException (exception .getMessage ());
6765 }
6866 }
6967 else {
70- config = null ;
68+ config = new Config ();
69+ config .write ();
7170 }
7271
7372 return config ;
You can’t perform that action at this time.
0 commit comments