aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/Danker/handlers
diff options
context:
space:
mode:
authorbowser0000 <bowser0000@gmail.com>2022-04-28 22:10:18 -0400
committerbowser0000 <bowser0000@gmail.com>2022-04-28 22:10:18 -0400
commit276734f87ce984e634e74a9a203402a93c7f7f12 (patch)
tree85aa0bd1240747a5bec8eab20e4ea188480c01ac /src/main/java/me/Danker/handlers
parent5586d4588c8d106a3b080bb45ba74b3c81113162 (diff)
downloadSkyblockMod-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.java11
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();
}