diff --git a/api/src/main/java/com/alttd/chat/config/Config.java b/api/src/main/java/com/alttd/chat/config/Config.java index b7d7305..2f7bfc0 100755 --- a/api/src/main/java/com/alttd/chat/config/Config.java +++ b/api/src/main/java/com/alttd/chat/config/Config.java @@ -38,9 +38,9 @@ public final class Config { CONFIGPATH = new File(File.separator + "mnt" + File.separator + "configs" + File.separator + "ChatPlugin"); CONFIG_FILE = new File(CONFIGPATH, "config.yml"); configLoader = YamlConfigurationLoader.builder() - .file(CONFIG_FILE) - .nodeStyle(NodeStyle.BLOCK) - .build(); + .file(CONFIG_FILE) + .nodeStyle(NodeStyle.BLOCK) + .build(); if (!CONFIG_FILE.getParentFile().exists()) { if (!CONFIG_FILE.getParentFile().mkdirs()) { return; @@ -182,11 +182,12 @@ public final class Config { private static void settings() { PREFIXGROUPS = getList("settings.prefix-groups", - Lists.newArrayList("discord", "socialmedia", "eventteam", "eventleader", "youtube", "twitch", "developer")); + Lists.newArrayList("discord", "socialmedia", "eventteam", "eventleader", "youtube", "twitch", + "developer")); CONFLICTINGPREFIXGROUPS = getList("settings.prefix-conflicts-groups", - Lists.newArrayList("eventteam", "eventleader")); + Lists.newArrayList("eventteam", "eventleader")); STAFFGROUPS = getList("settings.staff-groups", - Lists.newArrayList("trainee", "moderator", "headmod", "admin", "manager", "owner")); + Lists.newArrayList("trainee", "moderator", "headmod", "admin", "manager", "owner")); CONSOLENAME = getString("settings.console-name", CONSOLENAME); CONSOLEUUID = UUID.fromString(getString("settings.console-uuid", CONSOLEUUID.toString())); MINIMIUMSTAFFRANK = getString("settings.minimum-staff-rank", MINIMIUMSTAFFRANK); @@ -196,8 +197,10 @@ public final class Config { public static List MESSAGECOMMANDALIASES = new ArrayList<>(); public static List REPLYCOMMANDALIASES = new ArrayList<>(); - public static String MESSAGESENDER = " >(Me -> ) "; - public static String MESSAGERECIEVER = " >( on -> Me) "; + public static String MESSAGESENDER = + " >(Me -> ) "; + public static String MESSAGERECIEVER = + " >( on -> Me) "; public static String MESSAGESPY = "( -> ) "; public static String RECEIVER_DOES_NOT_EXIST = " is not a valid player."; @@ -212,7 +215,8 @@ public final class Config { RECEIVER_DOES_NOT_EXIST = getString("commands.message.receiver-does-not-exist", RECEIVER_DOES_NOT_EXIST); } - public static String GCFORMAT = " >to Global: "; + public static String GCFORMAT = + " >to Global: "; public static String GCPERMISSION = "proxy.globalchat"; public static List GCALIAS = new ArrayList<>(); public static String GCNOTENABLED = "You don't have global chat enabled."; @@ -228,7 +232,8 @@ public final class Config { GCCOOLDOWN = getInt("commands.globalchat.cooldown", GCCOOLDOWN); } - public static String CHATFORMAT = " > >: "; + public static String CHATFORMAT = + " > >: "; public static String URLFORMAT = ">"; private static void Chat() { @@ -237,7 +242,8 @@ public final class Config { } public static List GACECOMMANDALIASES = new ArrayList<>(); - public static String GACFORMAT = "( on -> Team) "; + public static String GACFORMAT = + "( on -> Team) "; private static void globalAdminChat() { GACECOMMANDALIASES = getList("commands.globaladminchat.aliases", Lists.newArrayList("acg")); @@ -269,12 +275,14 @@ public final class Config { } - public static String PARTY_FORMAT = "(\"> → ) "; - public static String PARTY_SPY = "PC: : "; + public static String PARTY_FORMAT = + "(\"> → ) "; + public static String PARTY_SPY = + "PC: : "; public static String NO_PERMISSION = "You don't have permission to use this command."; public static String NO_CONSOLE = "This command can not be used by console"; public static String CREATED_PARTY = "You created a chat party called: " + - "'' with the password: ''"; + "'' with the password: ''"; public static String NOT_IN_A_PARTY = "You're not in a chat party."; public static String NOT_YOUR_PARTY = "You don't own this chat party."; public static String NOT_A_PARTY = "This chat party does not exist."; @@ -284,9 +292,11 @@ public final class Config { public static String INVALID_PASSWORD = "Invalid password."; public static String JOINED_PARTY = "You joined !"; public static String PLAYER_JOINED_PARTY = " joined !"; - public static String NOTIFY_FINDING_NEW_OWNER = "Since you own this chat party a new party owner will be chosen."; + public static String NOTIFY_FINDING_NEW_OWNER = + "Since you own this chat party a new party owner will be chosen."; public static String LEFT_PARTY = "You have left the chat party!"; - public static String OWNER_LEFT_PARTY = "[ChatParty]: left the chat party, the new party owner is "; + public static String OWNER_LEFT_PARTY = + "[ChatParty]: left the chat party, the new party owner is "; public static String PLAYER_LEFT_PARTY = "[ChatParty]: left the chat party!"; public static String NEW_PARTY_OWNER = "[ChatParty]: transferred the party to !"; public static String CANT_REMOVE_PARTY_OWNER = "You can't remove yourself, please leave instead."; @@ -297,14 +307,16 @@ public final class Config { public static String ALREADY_IN_THIS_PARTY = "You're already in !"; public static String SENT_PARTY_INV = "You send a chat party invite to !"; public static String JOIN_PARTY_CLICK_MESSAGE = " '>" + - "You received an invite to join , click this message to accept."; + "You received an invite to join , click this message to accept."; public static String PARTY_MEMBER_LOGGED_ON = "[ChatParty] joined Altitude..."; public static String PARTY_MEMBER_LOGGED_OFF = "[ChatParty] left Altitude..."; - public static String RENAMED_PARTY = "[ChatParty] changed the party name from to !"; + public static String RENAMED_PARTY = + "[ChatParty] changed the party name from to !"; public static String CHANGED_PASSWORD = "Password was set to "; public static String DISBAND_PARTY_CONFIRM = "Are you sure you want to disband your party? " + - "Type /party disband confirm to confirm."; - public static String DISBANDED_PARTY = "[ChatParty] has disbanded , everyone has been removed."; + "Type /party disband confirm to confirm."; + public static String DISBANDED_PARTY = + "[ChatParty] has disbanded , everyone has been removed."; public static String PARTY_INFO = """ Chat party info: Name: @@ -353,16 +365,25 @@ public final class Config { public static String PARTY_HELP_WRAPPER = "ChatParty help:\n"; public static String PARTY_HELP_HELP = "Show this menu: /party help"; - public static String PARTY_HELP_CREATE = "Create a party: /party create "; - public static String PARTY_HELP_INFO = "Show info about your current party: /party info"; - public static String PARTY_HELP_INVITE = "Invite a user to your party: /party invite "; - public static String PARTY_HELP_JOIN = "Join a party: /party join "; + public static String PARTY_HELP_CREATE = + "Create a party: /party create "; + public static String PARTY_HELP_INFO = + "Show info about your current party: /party info"; + public static String PARTY_HELP_INVITE = + "Invite a user to your party: /party invite "; + public static String PARTY_HELP_JOIN = + "Join a party: /party join "; public static String PARTY_HELP_LEAVE = "Leave your current party: /party leave"; - public static String PARTY_HELP_NAME = "Change the name of your party: /party name "; - public static String PARTY_HELP_OWNER = "Change the owner of your party: /party owner "; - public static String PARTY_HELP_PASSWORD = "Change the password of your party: /party password "; - public static String PARTY_HELP_REMOVE = "Remove a member from your party: /party remove "; - public static String PARTY_HELP_DISBAND = "Remove everyone from your party and disband it: /party disband"; + public static String PARTY_HELP_NAME = + "Change the name of your party: /party name "; + public static String PARTY_HELP_OWNER = + "Change the owner of your party: /party owner "; + public static String PARTY_HELP_PASSWORD = + "Change the password of your party: /party password "; + public static String PARTY_HELP_REMOVE = + "Remove a member from your party: /party remove "; + public static String PARTY_HELP_DISBAND = + "Remove everyone from your party and disband it: /party disband"; public static String PARTY_HELP_CHAT = "Talk in party chat: /p "; private static void partyHelp() { @@ -385,12 +406,14 @@ public final class Config { public static ComponentLike TOGGLED_ON = null; public static ComponentLike TOGGLED_OFF = null; public static double LOCAL_DISTANCE; - public static String CHANNEL_SPY = "SPY: () "; + public static String CHANNEL_SPY = + "SPY: () "; private static void chatChannels() { ConfigurationNode node = getNode("chat-channels"); if (node.empty()) { - getString("chat-channels.ac.format", " >to : "); + getString("chat-channels.ac.format", + " >to : "); getList("chat-channels.ac.servers", List.of("lobby")); getBoolean("chat-channels.ac.proxy", false); node = getNode("chat-channels"); @@ -400,15 +423,17 @@ public final class Config { String channelName = Objects.requireNonNull(configurationNode.key()).toString(); String key = "chat-channels." + channelName + "."; new CustomChannel(channelName, - getString(key + "format", ""), - getList(key + "servers", Collections.EMPTY_LIST), - getBoolean(key + "proxy", false), - getBoolean(key + "local", false) + getString(key + "format", ""), + getList(key + "servers", Collections.EMPTY_LIST), + getList(key + "alias", Collections.EMPTY_LIST), + getBoolean(key + "proxy", false), + getBoolean(key + "local", false) ); } CUSTOM_CHANNEL_TOGGLED = getString("chat-channels-messages.channel-toggled", CUSTOM_CHANNEL_TOGGLED); - TOGGLED_ON = Utility.parseMiniMessage(getString("chat-channels-messages.channel-on", "on")); + TOGGLED_ON = + Utility.parseMiniMessage(getString("chat-channels-messages.channel-on", "on")); TOGGLED_OFF = Utility.parseMiniMessage(getString("chat-channels-messages.channel-off", "off")); LOCAL_DISTANCE = getDouble("chat-channels-messages.local-distance", 200.0); CHANNEL_SPY = getString("chat-channels-messages.spy", CHANNEL_SPY); @@ -443,12 +468,16 @@ public final class Config { } public static String mailHeader = "===== List Mails ====='"; - public static String mailBody = "From: [] '> day(s) ago: "; + public static String mailBody = + "From: [] '> day(s) ago: "; public static String mailFooter = "======================"; public static String mailNoUser = "A player with this name hasn't logged in recently."; - public static String mailReceived = "New mail from , click to view"; - public static String mailUnread = "You have unread mail, click to view it."; - public static String mailSent = "Successfully send mail to : <#2e8b57>"; + public static String mailReceived = + "New mail from , click to view"; + public static String mailUnread = + "You have unread mail, click to view it."; + public static String mailSent = + "Successfully send mail to : <#2e8b57>"; public static List mailCommandAlias = new ArrayList<>(); public static int mailDisplayDelay = 5; @@ -464,8 +493,10 @@ public final class Config { } public static HashMap serverChannelId = new HashMap<>(); - public static String REPORT_SENT = "Your report was sent, staff will contact you asap to help resolve your issue!"; - public static String REPORT_TOO_SHORT = "Please ensure your report is descriptive. We require at least 3 words per report"; + public static String REPORT_SENT = + "Your report was sent, staff will contact you asap to help resolve your issue!"; + public static String REPORT_TOO_SHORT = + "Please ensure your report is descriptive. We require at least 3 words per report"; private static void loadChannelIds() { serverChannelId.clear(); @@ -500,7 +531,8 @@ public final class Config { } public static String HELP_REPORT = "/report "; - public static String FIRST_JOIN = "* Welcome to Altitude! They've joined for the first time."; + public static String FIRST_JOIN = + "* Welcome to Altitude! They've joined for the first time."; private static void loadMessages() { HELP_REPORT = getString("settings.mail.mail-sent", HELP_REPORT); @@ -509,7 +541,8 @@ public final class Config { public static String EMOTELIST_HEADER = "Available Chat Emotes"; public static String EMOTELIST_ITEM = "\"> : "; - public static String EMOTELIST_FOOTER = "----<< Prev / Next >>----"; + public static String EMOTELIST_FOOTER = + "----<< Prev / Next >>----"; private static void emoteListCommand() { EMOTELIST_HEADER = getString("commands.emotelist.header", EMOTELIST_HEADER); @@ -521,31 +554,41 @@ public final class Config { public static String NICK_CHANGED = "Your nickname was changed to ."; public static String NICK_NOT_CHANGED = "Your nickname request was denied."; public static String NICK_RESET = "Nickname changed back to normal."; - public static String NICK_CHANGED_OTHERS = "'s nickname was changed to ."; - public static String NICK_TARGET_NICK_CHANGE = "Your nickname was changed to by "; + public static String NICK_CHANGED_OTHERS = + "'s nickname was changed to ."; + public static String NICK_TARGET_NICK_CHANGE = + "Your nickname was changed to by "; public static String NICK_RESET_OTHERS = "'s nickname was reset back to normal."; public static String NICK_INVALID_CHARACTERS = "You can only use letters and numbers in nicknames."; public static String NICK_INVALID_LENGTH = "Nicknames need to be between 3 to 16 characters long."; public static String NICK_PLAYER_NOT_ONLINE = "That player is not online."; public static String NICK_BLOCKED_COLOR_CODES = "You have blocked color codes in that nickname."; - public static String NICK_USER_NOT_FOUND = "Failed to set nickname from player, try again from a server this player has been on before."; - public static String NICK_ACCEPTED = "You accepted 's nickname. They are now called ."; - public static String NICK_DENIED = "You denied 's nickname. They are still called ."; + public static String NICK_USER_NOT_FOUND = + "Failed to set nickname from player, try again from a server this player has been on before."; + public static String NICK_ACCEPTED = + "You accepted 's nickname. They are now called ."; + public static String NICK_DENIED = + "You denied 's nickname. They are still called ."; public static String NICK_ALREADY_HANDLED = "'s nickname was already accepted or denied."; public static String NICK_NO_LUCKPERMS = "Due to an issue with LuckPerms /nick try won't work at the moment."; public static String NICK_TOO_SOON = "Please wait