diff options
author | bowser0000 <bowser0000@gmail.com> | 2022-04-28 22:10:18 -0400 |
---|---|---|
committer | bowser0000 <bowser0000@gmail.com> | 2022-04-28 22:10:18 -0400 |
commit | 276734f87ce984e634e74a9a203402a93c7f7f12 (patch) | |
tree | 85aa0bd1240747a5bec8eab20e4ea188480c01ac /src/main/java/me/Danker/handlers | |
parent | 5586d4588c8d106a3b080bb45ba74b3c81113162 (diff) | |
download | SkyblockMod-276734f87ce984e634e74a9a203402a93c7f7f12.tar.gz SkyblockMod-276734f87ce984e634e74a9a203402a93c7f7f12.tar.bz2 SkyblockMod-276734f87ce984e634e74a9a203402a93c7f7f12.zip |
Add chat aliases
Diffstat (limited to 'src/main/java/me/Danker/handlers')
-rw-r--r-- | src/main/java/me/Danker/handlers/ConfigHandler.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/main/java/me/Danker/handlers/ConfigHandler.java b/src/main/java/me/Danker/handlers/ConfigHandler.java index 65e5c78..4415a8e 100644 --- a/src/main/java/me/Danker/handlers/ConfigHandler.java +++ b/src/main/java/me/Danker/handlers/ConfigHandler.java @@ -246,6 +246,7 @@ public class ConfigHandler { ToggleCommand.hideArmour = initBoolean("toggles", "HideArmour", false); ToggleCommand.autoJoinSkyblock = initBoolean("toggles", "AutoJoinSkyblock", false); ToggleCommand.firePillar = initBoolean("toggles", "FirePillar", false); + ToggleCommand.aliases = initBoolean("toggles", "Aliases", false); // Chat Messages ToggleCommand.sceptreMessages = initBoolean("toggles", "SceptreMessages", true); ToggleCommand.midasStaffMessages = initBoolean("toggles", "MidasStaffMessages", true); @@ -719,6 +720,7 @@ public class ConfigHandler { Gson gson = new Gson(); try { + // Alerts if (!(new File(Alerts.configFile).exists())) { FileWriter file = new FileWriter(Alerts.configFile); file.write(new JsonArray().toString()); @@ -726,6 +728,15 @@ public class ConfigHandler { } Alerts.Alert[] alerts = gson.fromJson(new FileReader(Alerts.configFile), Alerts.Alert[].class); if (alerts != null) Alerts.alerts = new ArrayList<>(Arrays.asList(alerts)); + + // Aliases + if (!(new File(ChatAliases.configFile).exists())) { + FileWriter file = new FileWriter(ChatAliases.configFile); + file.write(new JsonArray().toString()); + file.close(); + } + ChatAliases.Alias[] aliases = gson.fromJson(new FileReader(ChatAliases.configFile), ChatAliases.Alias[].class); + if (aliases != null) ChatAliases.aliases = new ArrayList<>(Arrays.asList(aliases)); } catch (IOException ex) { ex.printStackTrace(); } |