2021-05-13 12:11:59 +00:00
package com.alttd.chat.config ;
2021-05-10 08:45:43 +00:00
2021-08-08 09:36:06 +00:00
import com.alttd.chat.objects.channels.CustomChannel ;
2021-05-10 08:45:43 +00:00
import com.google.common.base.Throwables ;
import com.google.common.collect.Lists ;
2021-11-29 14:37:19 +00:00
import io.leangen.geantyref.TypeToken ;
import org.spongepowered.configurate.ConfigurationNode ;
import org.spongepowered.configurate.serialize.SerializationException ;
import org.spongepowered.configurate.yaml.NodeStyle ;
2021-05-10 08:45:43 +00:00
import java.io.File ;
import java.io.IOException ;
import java.lang.reflect.InvocationTargetException ;
import java.lang.reflect.Method ;
import java.lang.reflect.Modifier ;
2021-08-05 09:40:42 +00:00
import java.util.* ;
2021-05-10 08:45:43 +00:00
import java.util.regex.Pattern ;
2021-11-29 14:37:19 +00:00
import org.spongepowered.configurate.yaml.YamlConfigurationLoader ;
import org.spongepowered.configurate.ConfigurationOptions ;
2021-05-10 08:45:43 +00:00
public final class Config {
private static final Pattern PATH_PATTERN = Pattern . compile ( " \\ . " ) ;
private static final String HEADER = " " ;
private static File CONFIG_FILE ;
public static ConfigurationNode config ;
2021-11-29 14:37:19 +00:00
public static YamlConfigurationLoader configLoader ;
2021-05-10 08:45:43 +00:00
static int version ;
static boolean verbose ;
2021-06-06 19:32:13 +00:00
public static File CONFIGPATH ;
2021-08-25 10:41:47 +00:00
public static void init ( ) {
2021-08-20 21:03:58 +00:00
CONFIGPATH = new File ( System . getProperty ( " user.home " ) + File . separator + " share " + File . separator + " configs " + File . separator + " ChatPlugin " ) ;
2021-08-18 22:59:37 +00:00
CONFIG_FILE = new File ( CONFIGPATH , " config.yml " ) ;
2021-11-29 14:37:19 +00:00
configLoader = YamlConfigurationLoader . builder ( )
. file ( CONFIG_FILE )
2021-12-11 19:20:36 +00:00
. nodeStyle ( NodeStyle . BLOCK )
2021-05-10 08:45:43 +00:00
. build ( ) ;
if ( ! CONFIG_FILE . getParentFile ( ) . exists ( ) ) {
if ( ! CONFIG_FILE . getParentFile ( ) . mkdirs ( ) ) {
return ;
}
}
if ( ! CONFIG_FILE . exists ( ) ) {
try {
if ( ! CONFIG_FILE . createNewFile ( ) ) {
return ;
}
} catch ( IOException error ) {
error . printStackTrace ( ) ;
}
}
try {
2022-01-05 13:09:36 +00:00
config = configLoader . load ( ConfigurationOptions . defaults ( ) . header ( HEADER ) . shouldCopyDefaults ( false ) ) ;
2021-05-10 08:45:43 +00:00
} catch ( IOException e ) {
e . printStackTrace ( ) ;
}
verbose = getBoolean ( " verbose " , true ) ;
version = getInt ( " config-version " , 1 ) ;
readConfig ( Config . class , null ) ;
try {
configLoader . save ( config ) ;
} catch ( IOException e ) {
e . printStackTrace ( ) ;
}
}
2021-08-18 22:59:37 +00:00
2021-05-10 08:45:43 +00:00
public static void readConfig ( Class < ? > clazz , Object instance ) {
for ( Method method : clazz . getDeclaredMethods ( ) ) {
if ( Modifier . isPrivate ( method . getModifiers ( ) ) ) {
if ( method . getParameterTypes ( ) . length = = 0 & & method . getReturnType ( ) = = Void . TYPE ) {
try {
method . setAccessible ( true ) ;
method . invoke ( instance ) ;
} catch ( InvocationTargetException | IllegalAccessException ex ) {
throw Throwables . propagate ( ex . getCause ( ) ) ;
}
}
}
}
try {
configLoader . save ( config ) ;
} catch ( IOException ex ) {
throw Throwables . propagate ( ex . getCause ( ) ) ;
}
}
public static void saveConfig ( ) {
try {
configLoader . save ( config ) ;
} catch ( IOException ex ) {
throw Throwables . propagate ( ex . getCause ( ) ) ;
}
}
private static Object [ ] splitPath ( String key ) {
return PATH_PATTERN . split ( key ) ;
}
private static void set ( String path , Object def ) {
2021-11-29 14:37:19 +00:00
if ( config . node ( splitPath ( path ) ) . virtual ( ) ) {
try {
config . node ( splitPath ( path ) ) . set ( def ) ;
} catch ( SerializationException e ) {
}
}
2021-05-10 08:45:43 +00:00
}
private static void setString ( String path , String def ) {
try {
2021-11-29 14:37:19 +00:00
if ( config . node ( splitPath ( path ) ) . virtual ( ) )
config . node ( splitPath ( path ) ) . set ( io . leangen . geantyref . TypeToken . get ( String . class ) , def ) ;
} catch ( SerializationException ex ) {
2021-05-10 08:45:43 +00:00
}
}
private static boolean getBoolean ( String path , boolean def ) {
set ( path , def ) ;
2021-11-29 14:37:19 +00:00
return config . node ( splitPath ( path ) ) . getBoolean ( def ) ;
2021-05-10 08:45:43 +00:00
}
private static double getDouble ( String path , double def ) {
set ( path , def ) ;
2021-11-29 14:37:19 +00:00
return config . node ( splitPath ( path ) ) . getDouble ( def ) ;
2021-05-10 08:45:43 +00:00
}
private static int getInt ( String path , int def ) {
set ( path , def ) ;
2021-11-29 14:37:19 +00:00
return config . node ( splitPath ( path ) ) . getInt ( def ) ;
2021-05-10 08:45:43 +00:00
}
private static String getString ( String path , String def ) {
setString ( path , def ) ;
2021-11-29 14:37:19 +00:00
return config . node ( splitPath ( path ) ) . getString ( def ) ;
2021-05-10 08:45:43 +00:00
}
private static Long getLong ( String path , Long def ) {
set ( path , def ) ;
2021-11-29 14:37:19 +00:00
return config . node ( splitPath ( path ) ) . getLong ( def ) ;
2021-05-10 08:45:43 +00:00
}
private static < T > List < String > getList ( String path , T def ) {
try {
set ( path , def ) ;
2021-11-29 14:37:19 +00:00
return config . node ( splitPath ( path ) ) . getList ( TypeToken . get ( String . class ) ) ;
} catch ( SerializationException ex ) {
2021-05-10 08:45:43 +00:00
}
return new ArrayList < > ( ) ;
}
2021-05-13 21:05:26 +00:00
private static ConfigurationNode getNode ( String path ) {
2021-11-29 14:37:19 +00:00
if ( config . node ( splitPath ( path ) ) . virtual ( ) ) {
2021-05-25 12:49:15 +00:00
//new RegexConfig("Dummy");
2021-05-13 21:05:26 +00:00
}
2021-11-29 14:37:19 +00:00
config . childrenMap ( ) ;
return config . node ( splitPath ( path ) ) ;
2021-05-13 21:05:26 +00:00
}
2021-05-10 08:45:43 +00:00
/** ONLY EDIT ANYTHING BELOW THIS LINE **/
public static List < String > PREFIXGROUPS = new ArrayList < > ( ) ;
2021-08-17 22:15:45 +00:00
public static List < String > CONFLICTINGPREFIXGROUPS = new ArrayList < > ( ) ;
2021-05-15 01:02:52 +00:00
public static List < String > STAFFGROUPS = new ArrayList < > ( ) ;
2021-05-15 19:39:51 +00:00
public static String MINIMIUMSTAFFRANK = " trainee " ;
2021-05-13 12:11:29 +00:00
public static String CONSOLENAME = " Console " ;
2021-06-13 11:53:49 +00:00
public static UUID CONSOLEUUID = UUID . randomUUID ( ) ;
2021-05-10 08:45:43 +00:00
private static void settings ( ) {
PREFIXGROUPS = getList ( " settings.prefix-groups " ,
Lists . newArrayList ( " discord " , " socialmedia " , " eventteam " , " eventleader " , " youtube " , " twitch " , " developer " ) ) ;
2021-08-17 22:15:45 +00:00
CONFLICTINGPREFIXGROUPS = getList ( " settings.prefix-conflicts-groups " ,
Lists . newArrayList ( " eventteam " , " eventleader " ) ) ;
2021-05-15 01:02:52 +00:00
STAFFGROUPS = getList ( " settings.staff-groups " ,
Lists . newArrayList ( " trainee " , " moderator " , " headmod " , " admin " , " manager " , " owner " ) ) ;
2021-05-13 12:11:29 +00:00
CONSOLENAME = getString ( " settings.console-name " , CONSOLENAME ) ;
2021-06-13 11:53:49 +00:00
CONSOLEUUID = UUID . fromString ( getString ( " settings.console-uuid " , CONSOLEUUID . toString ( ) ) ) ;
2021-05-15 19:39:51 +00:00
MINIMIUMSTAFFRANK = getString ( " settings.minimum-staff-rank " , MINIMIUMSTAFFRANK ) ;
2021-05-10 08:45:43 +00:00
}
public static List < String > MESSAGECOMMANDALIASES = new ArrayList < > ( ) ;
public static List < String > REPLYCOMMANDALIASES = new ArrayList < > ( ) ;
2021-07-27 16:46:58 +00:00
public static String MESSAGESENDER = " <hover:show_text:Click to reply><click:suggest_command:/msg <receivername> ><light_purple>(Me -> <gray><receiver></gray>)</hover> <message> " ;
public static String MESSAGERECIEVER = " <hover:show_text:Click to reply><click:suggest_command:/msg <sendername> ><light_purple>(<gray><sender></gray> on <server> -> Me)</hover> <message> " ;
2021-07-28 18:42:09 +00:00
public static String MESSAGESPY = " <gray>(<gray><sendername></gray> -> <receivername>) <message> " ;
2021-05-10 08:45:43 +00:00
private static void messageCommand ( ) {
MESSAGECOMMANDALIASES . clear ( ) ;
REPLYCOMMANDALIASES . clear ( ) ;
MESSAGECOMMANDALIASES = getList ( " commands.message.aliases " , Lists . newArrayList ( " msg " , " whisper " , " tell " ) ) ;
REPLYCOMMANDALIASES = getList ( " commands.reply.aliases " , Lists . newArrayList ( " r " ) ) ;
MESSAGESENDER = getString ( " commands.message.sender-message " , MESSAGESENDER ) ;
MESSAGERECIEVER = getString ( " commands.message.reciever-message " , MESSAGERECIEVER ) ;
2021-07-28 18:42:09 +00:00
MESSAGESPY = getString ( " commands.message.spy-message " , MESSAGESPY ) ;
2021-05-10 08:45:43 +00:00
}
2021-07-27 16:46:58 +00:00
2021-05-25 14:54:19 +00:00
public static String GCFORMAT = " <white><light_purple><prefix></light_purple> <gray><sender></gray> <hover:show_text:on <server>><yellow>to Global</yellow></hover><gray>: <message> " ;
2021-05-10 08:45:43 +00:00
public static String GCPERMISSION = " proxy.globalchat " ;
2021-05-22 18:34:32 +00:00
public static List < String > GCALIAS = new ArrayList < > ( ) ;
2021-08-25 10:41:47 +00:00
public static String GCNOTENABLED = " You don't have global chat enabled. " ;
public static String GCONCOOLDOWN = " You have to wait <cooldown> seconds before using this feature again. " ;
2021-06-06 19:32:13 +00:00
public static int GCCOOLDOWN = 30 ;
2021-05-10 08:45:43 +00:00
private static void globalChat ( ) {
2021-07-27 16:46:58 +00:00
GCFORMAT = getString ( " commands.globalchat.format " , GCFORMAT ) ;
2021-05-10 08:45:43 +00:00
GCPERMISSION = getString ( " commands.globalchat.view-chat-permission " , GCPERMISSION ) ;
2021-05-22 18:34:32 +00:00
GCALIAS . clear ( ) ;
GCALIAS = getList ( " commands.globalchat.alias " , Lists . newArrayList ( " gc " , " global " ) ) ;
GCNOTENABLED = getString ( " commands.globalchat.not-enabled " , GCNOTENABLED ) ;
2021-06-06 19:32:13 +00:00
GCCOOLDOWN = getInt ( " commands.globalchat.cooldown " , GCCOOLDOWN ) ;
2021-05-10 08:45:43 +00:00
}
2021-08-07 14:20:01 +00:00
public static String CHATFORMAT = " <white><light_purple><prefixall> <gray><hover:show_text:Click to message <sendername>><click:suggest_command:/msg <sendername> ><sender></hover>: <white><message> " ;
2021-08-17 20:54:24 +00:00
public static String URLFORMAT = " <click:OPEN_URL:<clickurl>><url></click> " ;
2021-06-23 18:18:22 +00:00
private static void Chat ( ) {
CHATFORMAT = getString ( " chat.format " , CHATFORMAT ) ;
2021-08-17 20:54:24 +00:00
URLFORMAT = getString ( " chat.urlformat " , URLFORMAT ) ;
2021-06-23 18:18:22 +00:00
}
2021-05-10 08:45:43 +00:00
public static List < String > GACECOMMANDALIASES = new ArrayList < > ( ) ;
2021-07-27 16:46:58 +00:00
public static String GACFORMAT = " <hover:show_text:Click to reply><click:suggest_command:/acg ><yellow>(<sender> on <server> -> Team)</hover> <message> " ;
2021-05-10 08:45:43 +00:00
private static void globalAdminChat ( ) {
GACECOMMANDALIASES = getList ( " commands.globaladminchat.aliases " , Lists . newArrayList ( " acg " ) ) ;
GACFORMAT = getString ( " commands.globaladminchat.format " , GACFORMAT ) ;
}
2021-05-13 18:27:20 +00:00
public static String MESSAGECHANNEL = " altitude:chatplugin " ;
private static void messageChannels ( ) {
MESSAGECHANNEL = getString ( " settings.message-channel " , MESSAGECHANNEL ) ;
}
2021-05-13 21:05:26 +00:00
public static ConfigurationNode REGEXNODE = null ;
private static void RegexNOde ( ) {
REGEXNODE = getNode ( " regex-settings " ) ;
}
2021-05-25 14:54:19 +00:00
public static String SERVERSWTICHMESSAGEFROM = " <gray>* <player> comes from <from_server>... " ;
2021-05-15 11:26:31 +00:00
public static String SERVERSWTICHMESSAGETO = " <gray>* <player> leaves to <to_server>... " ;
public static String SERVERJOINMESSAGE = " <green>* <player> appears from thin air... " ;
public static String SERVERLEAVEMESSAGE = " <red>* <player> vanishes in the mist... " ;
2021-05-15 09:42:54 +00:00
private static void JoinLeaveMessages ( ) {
SERVERSWTICHMESSAGEFROM = getString ( " messages.switch-server-from " , SERVERSWTICHMESSAGEFROM ) ;
SERVERSWTICHMESSAGETO = getString ( " messages.switch-server-to " , SERVERSWTICHMESSAGETO ) ;
SERVERJOINMESSAGE = getString ( " messages.join-server " , SERVERJOINMESSAGE ) ;
SERVERLEAVEMESSAGE = getString ( " messages.leave-server " , SERVERLEAVEMESSAGE ) ;
}
2022-01-30 01:12:09 +00:00
public static String PARTY_FORMAT = " <dark_aqua>(<gray><sender></gray> <hover:show_text:on <server>> → Party</hover>) <message> " ;
public static String PARTY_SPY = " <i><gray>PC:</gray><dark_gray> <dark_gray><sendername></dark_gray>: <dark_gray><partyname></dark_gray> <message></dark_gray></i> " ;
public static String NO_PERMISSION = " <red>You don't have permission to use this command.</red> " ;
public static String NO_CONSOLE = " <red>This command can not be used by console</red> " ;
public static String CREATED_PARTY = " <green>You created a chat party called: " +
" '<gold><party_name></gold>' with the password: '<gold><party_password></gold>'</green> " ;
public static String NOT_IN_A_PARTY = " <red>You're not in a chat party.</red> " ;
public static String NOT_YOUR_PARTY = " <red>You don't own this chat party.</red> " ;
public static String NOT_A_PARTY = " <red>This chat party does not exist.</red> " ;
2022-01-30 16:50:18 +00:00
public static String PARTY_EXISTS = " <red>A chat party called <party> already exists.</red> " ;
2022-01-30 01:12:09 +00:00
public static String INVALID_PLAYER = " <red>Invalid player.</red> " ;
public static String NOT_ONLINE = " <red><player> must be online to receive an invite.</red> " ;
public static String INVALID_PASSWORD = " <red>Invalid password.</red> " ;
public static String JOINED_PARTY = " <green>You joined <party_name>!</green> " ;
public static String NOTIFY_FINDING_NEW_OWNER = " <dark_aqua>Since you own this chat party a new party owner will be chosen.<dark_aqua> " ;
public static String LEFT_PARTY = " <green>You have left the chat party!</green> " ;
2022-01-30 16:50:18 +00:00
public static String OWNER_LEFT_PARTY = " <dark_aqua>[ChatParty]: <old_owner> left the chat party, the new party owner is <new_owner> " ;
public static String NEW_PARTY_OWNER = " <dark_aqua>[ChatParty]: <old_owner> transferred the party to <new_owner>! " ;
public static String CANT_REMOVE_PARTY_OWNER = " <red>You can't remove yourself, please leave instead.</red> " ;
public static String REMOVED_FROM_PARTY = " <red>You were removed from the '<party>' chat party.</red> " ;
public static String REMOVED_USER_FROM_PARTY = " <green>You removed <player> from the chat party!</green> " ;
public static String NOT_A_PARTY_MEMBER = " <player> is not a member of your party! " ;
public static String PARTY_INFO = """
< gold > < bold > Chat party info < / bold > :
< / gold > < green > Name : < dark_aqua > < party > < / dark_aqua >
Password : < dark_aqua > < password > < / dark_aqua >
Owner : < owner >
Members : < members > " " " ;
2022-01-30 01:12:09 +00:00
private static void party ( ) {
PARTY_FORMAT = getString ( " party.format " , PARTY_FORMAT ) ;
PARTY_SPY = getString ( " party.spy " , PARTY_SPY ) ;
NO_PERMISSION = getString ( " party.messages.no-permission " , NO_PERMISSION ) ;
NO_CONSOLE = getString ( " party.messages.no-console " , NO_CONSOLE ) ;
CREATED_PARTY = getString ( " party.messages.created-party " , CREATED_PARTY ) ;
NOT_IN_A_PARTY = getString ( " party.messages.not-in-a-party " , NOT_IN_A_PARTY ) ;
NOT_YOUR_PARTY = getString ( " party.messages.not-your-party " , NOT_YOUR_PARTY ) ;
NOT_A_PARTY = getString ( " party.messages.not-a-party " , NOT_A_PARTY ) ;
INVALID_PLAYER = getString ( " party.messages.invalid-player " , INVALID_PLAYER ) ;
NOT_ONLINE = getString ( " party.messages.not-online " , NOT_ONLINE ) ;
INVALID_PASSWORD = getString ( " party.messages.invalid-password " , INVALID_PASSWORD ) ;
NOTIFY_FINDING_NEW_OWNER = getString ( " party.messages.notify-finding-new-owner " , NOTIFY_FINDING_NEW_OWNER ) ;
LEFT_PARTY = getString ( " party.messages.left-party " , LEFT_PARTY ) ;
2022-01-30 16:50:18 +00:00
OWNER_LEFT_PARTY = getString ( " party.messages.owner-left-party " , OWNER_LEFT_PARTY ) ;
NEW_PARTY_OWNER = getString ( " party.messages.new-owner " , NEW_PARTY_OWNER ) ;
CANT_REMOVE_PARTY_OWNER = getString ( " party.messages.cant-remove-owner " , CANT_REMOVE_PARTY_OWNER ) ;
REMOVED_FROM_PARTY = getString ( " party.messages.removed-from-party " , REMOVED_FROM_PARTY ) ;
NOT_A_PARTY_MEMBER = getString ( " party.messages.not-a-party-member " , NOT_A_PARTY_MEMBER ) ;
PARTY_INFO = getString ( " party.messages.party-info " , PARTY_INFO ) ;
}
public static String PARTY_HELP_WRAPPER = " <gold>ChatParty help: \ n<commands></gold> " ;
public static String PARTY_HELP_HELP = " <green>Show this menu: <gold>/party help</gold></green> " ;
public static String PARTY_HELP_CREATE = " <green>Create a party: <gold>/party create <party_name> <party_password></gold></green> " ;
public static String PARTY_HELP_INFO = " <green>Show info about your current party: <gold>/party info</gold></green> " ;
public static String PARTY_HELP_INVITE = " <green>Invite a user to your party: <gold>/party invite <username></gold></green> " ;
public static String PARTY_HELP_JOIN = " <green>Join a party: <gold>/party join <party_name> <party_password></gold></green> " ;
public static String PARTY_HELP_LEAVE = " <green>Leave your current party: <gold>/party leave</gold></green> " ;
public static String PARTY_HELP_NAME = " <green>Change the name of your party: <gold>/party name <new_name></gold></green> " ;
public static String PARTY_HELP_OWNER = " <green>Change the owner of your party: <gold>/party owner <new_owner_name></gold></green> " ;
public static String PARTY_HELP_PASSWORD = " <green>Change the password of your party: <gold>/party password <new_password></gold></green> " ;
public static String PARTY_HELP_REMOVE = " <green>Remove a member from your party: <gold>/party remove <member_name></gold></green> " ;
private static void partyHelp ( ) {
PARTY_HELP_WRAPPER = getString ( " party.help.wrapper " , PARTY_HELP_WRAPPER ) ;
PARTY_HELP_HELP = getString ( " party.help.help " , PARTY_HELP_HELP ) ;
PARTY_HELP_CREATE = getString ( " party.help.create " , PARTY_HELP_CREATE ) ;
PARTY_HELP_INFO = getString ( " party.help.info " , PARTY_HELP_INFO ) ;
PARTY_HELP_INVITE = getString ( " party.help.invite " , PARTY_HELP_INVITE ) ;
PARTY_HELP_JOIN = getString ( " party.help.join " , PARTY_HELP_JOIN ) ;
PARTY_HELP_LEAVE = getString ( " party.help.leave " , PARTY_HELP_LEAVE ) ;
PARTY_HELP_NAME = getString ( " party.help.name " , PARTY_HELP_NAME ) ;
PARTY_HELP_OWNER = getString ( " party.help.owner " , PARTY_HELP_OWNER ) ;
PARTY_HELP_PASSWORD = getString ( " party.help.password " , PARTY_HELP_PASSWORD ) ;
PARTY_HELP_REMOVE = getString ( " party.help.remove " , PARTY_HELP_REMOVE ) ;
2022-01-30 01:12:09 +00:00
}
2021-08-04 13:46:45 +00:00
private static void chatChannels ( ) {
2021-08-05 09:40:42 +00:00
ConfigurationNode node = getNode ( " chat-channels " ) ;
2021-11-29 14:37:19 +00:00
if ( node . empty ( ) ) {
2021-08-05 09:40:42 +00:00
getString ( " chat-channels.ac.format " , " <white><gray><sender></gray> <hover:show_text:on <server>><yellow>to <channel></yellow></hover><gray>: <message> " ) ;
getList ( " chat-channels.ac.servers " , List . of ( " lobby " ) ) ;
getBoolean ( " chat-channels.ac.proxy " , false ) ;
node = getNode ( " chat-channels " ) ;
}
2021-11-29 14:37:19 +00:00
for ( ConfigurationNode configurationNode : node . childrenMap ( ) . values ( ) ) {
String channelName = Objects . requireNonNull ( configurationNode . key ( ) ) . toString ( ) ;
2021-08-05 09:40:42 +00:00
String key = " chat-channels. " + channelName + " . " ;
2021-08-08 09:36:06 +00:00
new CustomChannel ( channelName ,
2021-08-05 09:40:42 +00:00
getString ( key + " format " , " " ) ,
getList ( key + " servers " , Collections . EMPTY_LIST ) ,
getBoolean ( key + " proxy " , false ) ) ;
}
2021-08-04 13:46:45 +00:00
}
2022-01-27 20:09:23 +00:00
public static String SERVERMUTEPERMISSION = " chat.command.mute-server " ;
2021-08-01 13:08:05 +00:00
public static String SPYPERMISSION = " chat.socialspy " ;
2021-07-30 21:23:16 +00:00
private static void permissions ( ) {
SERVERMUTEPERMISSION = getString ( " permissions.server-mute " , SERVERMUTEPERMISSION ) ;
2021-08-01 13:08:05 +00:00
SPYPERMISSION = getString ( " permissions.server-mute " , SPYPERMISSION ) ;
2021-07-30 21:23:16 +00:00
}
2021-05-15 09:42:54 +00:00
public static String IP = " 0.0.0.0 " ;
public static String PORT = " 3306 " ;
public static String DATABASE = " database " ;
public static String USERNAME = " root " ;
public static String PASSWORD = " root " ;
private static void database ( ) {
IP = getString ( " database.ip " , IP ) ;
PORT = getString ( " database.port " , PORT ) ;
DATABASE = getString ( " database.name " , DATABASE ) ;
USERNAME = getString ( " database.username " , USERNAME ) ;
PASSWORD = getString ( " database.password " , PASSWORD ) ;
}
2021-08-25 20:11:29 +00:00
public static String NOTIFICATIONFORMAT = " <red>[<prefix>] <displayname> <target> <input> " ;
private static void notificationSettings ( ) {
NOTIFICATIONFORMAT = getString ( " settings.blockedmessage-notification " , NOTIFICATIONFORMAT ) ;
}
2022-01-29 22:21:35 +00:00
public static String mailHeader = " ===== List Mails =====' " ;
public static String mailBody = " <white>From:</white> <staffprefix><sender> <white>on:<date></white> \ n<message> " ;
public static String mailFooter = " ====================== " ;
public static String mailNoUser = " <red>A player with this name hasn't logged in recently. " ;
public static List < String > mailCommandAlias = new ArrayList < > ( ) ;
private static void mailSettings ( ) {
mailHeader = getString ( " settings.mail.header " , mailHeader ) ;
mailBody = getString ( " settings.mail.message " , mailBody ) ;
mailFooter = getString ( " settings.mail.footer " , mailFooter ) ;
mailCommandAlias = getList ( " settings.mail.command-aliases " , Lists . newArrayList ( " gmail " ) ) ;
}
2021-05-10 08:45:43 +00:00
}