Skip to content

Commit

Permalink
some fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
koxx12-dev committed Aug 14, 2021
1 parent 0f48248 commit 853b47f
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 8 deletions.
9 changes: 7 additions & 2 deletions src/main/java/io/github/koxx12dev/scc/SkyclientCosmetics.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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");

Expand Down
10 changes: 5 additions & 5 deletions src/main/java/io/github/koxx12dev/scc/gui/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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")
Expand Down Expand Up @@ -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<Settings> SettingsClass = Settings.class;

Expand Down
7 changes: 7 additions & 0 deletions src/main/java/io/github/koxx12dev/scc/utils/Files.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/io/github/koxx12dev/scc/utils/Requests.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> keys = Lists.newArrayList(CacheManager.getCache("userCache").getRawAsJsonObject().keySet().iterator());

Expand Down

0 comments on commit 853b47f

Please sign in to comment.