diff options
author | Maximusbarcz <maxim.baranek@gmail.com> | 2022-10-19 18:42:37 +0200 |
---|---|---|
committer | Maximusbarcz <maxim.baranek@gmail.com> | 2022-10-19 18:42:37 +0200 |
commit | 0a587147d29dc0bc0fd5aeb98a67e3d76719b0d9 (patch) | |
tree | 5cc3bac4c57e8b7cb57743ef323a79a255e9f8fe /src/main/java/dev/mayaqq/ygasi/registry/ConfigRegistry.java | |
parent | 11e5e2ddc52c8db91738204afef06d8a93b0f986 (diff) | |
download | ygasi-0a587147d29dc0bc0fd5aeb98a67e3d76719b0d9.tar.gz ygasi-0a587147d29dc0bc0fd5aeb98a67e3d76719b0d9.tar.bz2 ygasi-0a587147d29dc0bc0fd5aeb98a67e3d76719b0d9.zip |
reclaim ygasi from the leftoids (Please help this is not working code im just commiting so I can work on this when I get to italy AAAAAAAAAAAAA)
Diffstat (limited to 'src/main/java/dev/mayaqq/ygasi/registry/ConfigRegistry.java')
-rw-r--r-- | src/main/java/dev/mayaqq/ygasi/registry/ConfigRegistry.java | 30 |
1 files changed, 3 insertions, 27 deletions
diff --git a/src/main/java/dev/mayaqq/ygasi/registry/ConfigRegistry.java b/src/main/java/dev/mayaqq/ygasi/registry/ConfigRegistry.java index 799506e..b34af4b 100644 --- a/src/main/java/dev/mayaqq/ygasi/registry/ConfigRegistry.java +++ b/src/main/java/dev/mayaqq/ygasi/registry/ConfigRegistry.java @@ -8,15 +8,14 @@ import java.io.*; import java.nio.file.Files; import java.util.HashMap; import java.util.Map; +import java.util.UUID; public class ConfigRegistry { public static Config CONFIG = new Config(); - public static ServerData SERVERDATA = new ServerData(); - private static File modConfFolder = new File(FabricLoader.getInstance().getConfigDir().toFile(),"ygasi"); + static File modConfFolder = new File(FabricLoader.getInstance().getConfigDir().toFile(),"ygasi"); private static File configFile = new File(modConfFolder,"config.json"); - private static File serverDatFile = new File(modConfFolder,"serverDat.json"); private static final Gson gson = new GsonBuilder().setPrettyPrinting().create(); public static void load() { @@ -39,20 +38,6 @@ public class ConfigRegistry { throw new RuntimeException(e); } } - if (!serverDatFile.exists()) { - try { - serverDatFile.createNewFile(); - saveServerData(); - } catch (IOException e) { - throw new RuntimeException(e); - } - } else { - try { - SERVERDATA = gson.fromJson(new FileReader(serverDatFile), ServerData.class); - } catch (FileNotFoundException e) { - throw new RuntimeException(e); - } - } } public static void saveConfig() throws IOException { @@ -61,19 +46,10 @@ public class ConfigRegistry { writer.write(gson.toJson(CONFIG)); writer.close(); } - public static void saveServerData() throws IOException { - var Writer = new FileWriter(serverDatFile); - Writer.write(gson.toJson(SERVERDATA)); - Writer.close(); - } + public static class Config { //the thing to write in the config file public int pointsRewarded = 1; public Config() {} } - public static class ServerData { - //the things to write in the serverData file, this is only temporary for now - public String Comment = "This File should store all the data for the players when they open the gui. Maybe this will get removed when I learn SQL? (never)"; - public ServerData() {} - } } |