From 853b47fac4e93caebaae2d87bba809ccc8d3bcf6 Mon Sep 17 00:00:00 2001 From: koxx12-dev <80456351+koxx12-dev@users.noreply.github.com> Date: Sat, 14 Aug 2021 12:57:05 +0200 Subject: [PATCH] some fixes --- .../io/github/koxx12dev/scc/SkyclientCosmetics.java | 9 +++++++-- .../java/io/github/koxx12dev/scc/gui/Settings.java | 10 +++++----- src/main/java/io/github/koxx12dev/scc/utils/Files.java | 7 +++++++ .../java/io/github/koxx12dev/scc/utils/Requests.java | 2 +- 4 files changed, 20 insertions(+), 8 deletions(-) diff --git a/src/main/java/io/github/koxx12dev/scc/SkyclientCosmetics.java b/src/main/java/io/github/koxx12dev/scc/SkyclientCosmetics.java index ef0485e..45078b7 100644 --- a/src/main/java/io/github/koxx12dev/scc/SkyclientCosmetics.java +++ b/src/main/java/io/github/koxx12dev/scc/SkyclientCosmetics.java @@ -25,6 +25,7 @@ import io.github.koxx12dev.scc.listeners.GuiListners; import io.github.koxx12dev.scc.listeners.PlayerListeners; import io.github.koxx12dev.scc.rpc.RPC; +import io.github.koxx12dev.scc.utils.Files; import io.github.koxx12dev.scc.utils.Requests; import io.github.koxx12dev.scc.utils.exceptions.APIException; import io.github.koxx12dev.scc.utils.exceptions.CacheException; @@ -72,9 +73,13 @@ public class SkyclientCosmetics { public static String rankColor; @Mod.EventHandler -public void onPreInit(FMLPreInitializationEvent event) throws IOException, CacheException, APIException, NoSuchFieldException { +public void onPreInit(FMLPreInitializationEvent event) throws IOException, CacheException, APIException { - ProgressManager.ProgressBar progress = ProgressManager.push("Pre Init Setup", 4); + ProgressManager.ProgressBar progress = ProgressManager.push("Pre Init Setup", 5); + + progress.step("Setting up Files"); + + Files.setup(); progress.step("Loading Vigilance"); diff --git a/src/main/java/io/github/koxx12dev/scc/gui/Settings.java b/src/main/java/io/github/koxx12dev/scc/gui/Settings.java index 3695c0d..2f6bc21 100644 --- a/src/main/java/io/github/koxx12dev/scc/gui/Settings.java +++ b/src/main/java/io/github/koxx12dev/scc/gui/Settings.java @@ -40,7 +40,7 @@ public class Settings extends Vigilant { @Property(type = PropertyType.SWITCH, name = "Shorten custom tag", description = "Shortens all custom tags in new messages", category = "Main", subcategory = "Tags") public static boolean shortenTags = false; - @Property(type = PropertyType.BUTTON, name = "Reload Tags", description = "Reloads custom tags", category = "Main", subcategory = "Tags") + @Property(type = PropertyType.BUTTON, name = "Reload Tags", description = "Reloads custom tags", category = "Main", subcategory = "Tags", placeholder = "Reload") public static void reloadTags() throws APIException, CacheException, IOException { SkyclientCosmetics.api = Requests.getApiData(); if (SkyclientCosmetics.apiConnectionSuccess) { @@ -57,13 +57,13 @@ public static void reloadTags() throws APIException, CacheException, IOException @Property(type = PropertyType.SWITCH, name = "Show Debug info in the logs", description = "Spams your logs as fuck", category = "DEBUG", subcategory = "Logs") public static boolean debugLogs = false; - @Property(type = PropertyType.TEXT, name = "Discord RPC Second Line", description = "Allows you to set second line of the Discord RPC", category = "Main", subcategory = "Discord Rich Presence") + @Property(type = PropertyType.TEXT, name = "Discord RPC Second Line", description = "Allows you to set second line of the Discord RPC\n\u00A7aAllows usage of Placeholders. More info on the wiki (https://github.com/koxx12-dev/Skyclient-Cosmetics/wiki/Discord-RPC)", category = "Main", subcategory = "Discord Rich Presence") public static String rpcLineTwo = "SBE bad"; - @Property(type = PropertyType.TEXT, name = "Discord RPC First Line", description = "Allows you to set the first line of the Discord RPC", category = "Main", subcategory = "Discord Rich Presence") + @Property(type = PropertyType.TEXT, name = "Discord RPC First Line", description = "Allows you to set the first line of the Discord RPC\n\u00A7aAllows usage of Placeholders. More info on the wiki (https://github.com/koxx12-dev/Skyclient-Cosmetics/wiki/Discord-RPC)", category = "Main", subcategory = "Discord Rich Presence") public static String rpcLineOne = "%player% is very cool"; - @Property(type = PropertyType.TEXT, name = "Discord RPC Img Text", description = "Allows you to set text of the img\n\u00A7cAllows usage of Placeholders ()", category = "Main", subcategory = "Discord Rich Presence") + @Property(type = PropertyType.TEXT, name = "Discord RPC Img Text", description = "Allows you to set text of the img\n\u00A7aAllows usage of Placeholders. More info on the wiki (https://github.com/koxx12-dev/Skyclient-Cosmetics/wiki/Discord-RPC)", category = "Main", subcategory = "Discord Rich Presence") public static String rpcImgText = "SkyClient is cool"; @Property(type = PropertyType.SWITCH, name = "Discord RPC", description = "Enables Discord RPC", category = "Main", subcategory = "Discord Rich Presence") @@ -94,7 +94,7 @@ public static void reloadTags() throws APIException, CacheException, IOException //public static String SCCApiKey = ""; public Settings() { - super(new File("./config/skyclientcosmetics.toml")); + super(new File("./SkyclientCosmetics/skyclientcosmetics.toml")); //final Class SettingsClass = Settings.class; diff --git a/src/main/java/io/github/koxx12dev/scc/utils/Files.java b/src/main/java/io/github/koxx12dev/scc/utils/Files.java index 1a69438..e6e6eec 100644 --- a/src/main/java/io/github/koxx12dev/scc/utils/Files.java +++ b/src/main/java/io/github/koxx12dev/scc/utils/Files.java @@ -22,6 +22,13 @@ import java.io.File; public class Files { + public static void setup() { + + if (!CacheManager.sccFolder.exists()) { + CacheManager.sccFolder.mkdir(); + } + + } public static boolean hidePetZord() { return new File(CacheManager.sccFolder,"HIDEPETZORD").exists(); } diff --git a/src/main/java/io/github/koxx12dev/scc/utils/Requests.java b/src/main/java/io/github/koxx12dev/scc/utils/Requests.java index a8bcbdf..e2b95e9 100644 --- a/src/main/java/io/github/koxx12dev/scc/utils/Requests.java +++ b/src/main/java/io/github/koxx12dev/scc/utils/Requests.java @@ -109,7 +109,7 @@ public static void reloadTags() throws IOException, CacheException { public static JsonObject getApiData() throws IOException, CacheException, APIException { try { SkyclientCosmetics.apiConnectionSuccess = true; - return JsonParser.parseString(Requests.request("https://kkkkoxx12-dev.github.io/api/scc/tags.json")).getAsJsonObject(); + return JsonParser.parseString(Requests.request("https://koxx12-dev.github.io/api/scc/tags.json")).getAsJsonObject(); } catch (Exception e) { List keys = Lists.newArrayList(CacheManager.getCache("userCache").getRawAsJsonObject().keySet().iterator());