From 0a587147d29dc0bc0fd5aeb98a67e3d76719b0d9 Mon Sep 17 00:00:00 2001 From: Maximusbarcz Date: Wed, 19 Oct 2022 18:42:37 +0200 Subject: 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) --- .../dev/mayaqq/ygasi/registry/ConfigRegistry.java | 30 +++------------------- 1 file changed, 3 insertions(+), 27 deletions(-) (limited to 'src/main/java/dev/mayaqq/ygasi/registry/ConfigRegistry.java') 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() {} - } } -- cgit