-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
46 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package pojlib.util; | ||
|
||
import java.io.File; | ||
import java.util.ArrayList; | ||
|
||
public class ConfigUtil { | ||
|
||
public static Config config; | ||
public static File configFile = new File(Constants.CONFIG_PATH); | ||
|
||
public static void LoadConfig() { | ||
if (configFile.exists()) { | ||
config = GsonUtils.jsonFileToObject(configFile.getAbsolutePath(), Config.class); | ||
} else { | ||
config = new Config(); | ||
GsonUtils.objectToJsonFile(configFile.getAbsolutePath(), config); | ||
} | ||
} | ||
|
||
public static void SaveConfig() { | ||
GsonUtils.objectToJsonFile(configFile.getAbsolutePath(), config); | ||
LoadConfig(); | ||
} | ||
|
||
public static class Config { | ||
public boolean acceptedLegal = false; | ||
public boolean setDevMods = false; | ||
public boolean setCustomRAM = false; | ||
public String customRAMValue = "2048"; | ||
public int lastSelectedInstance = 0; | ||
public int lastSelectedAccount = 0; | ||
public ArrayList<Accounts> accounts = new ArrayList<>(); | ||
} | ||
|
||
public static class Accounts { | ||
public String username; | ||
public String uuid; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters