2015-10-19 17:43:46 +00:00
|
|
|
package me.totalfreedom.totalfreedommod.config;
|
2013-08-17 22:24:40 +00:00
|
|
|
|
2018-02-22 12:55:04 +00:00
|
|
|
import java.util.List;
|
2018-07-31 07:01:29 +00:00
|
|
|
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
2018-02-22 12:55:04 +00:00
|
|
|
|
2018-03-24 15:41:45 +00:00
|
|
|
|
2015-10-19 17:43:46 +00:00
|
|
|
public enum ConfigEntry
|
2013-08-17 22:24:40 +00:00
|
|
|
{
|
2014-10-31 17:47:05 +00:00
|
|
|
FORCE_IP_ENABLED(Boolean.class, "forceip.enabled"),
|
2014-11-13 20:14:21 +00:00
|
|
|
FORCE_IP_PORT(Integer.class, "forceip.port"),
|
2014-10-31 17:47:05 +00:00
|
|
|
FORCE_IP_KICKMSG(String.class, "forceip.kickmsg"),
|
|
|
|
//
|
2014-04-26 11:21:36 +00:00
|
|
|
ALLOW_EXPLOSIONS(Boolean.class, "allow.explosions"),
|
|
|
|
ALLOW_FIRE_PLACE(Boolean.class, "allow.fire_place"),
|
|
|
|
ALLOW_FIRE_SPREAD(Boolean.class, "allow.fire_spread"),
|
|
|
|
ALLOW_FLUID_SPREAD(Boolean.class, "allow.fluid_spread"),
|
|
|
|
ALLOW_LAVA_DAMAGE(Boolean.class, "allow.lava_damage"),
|
|
|
|
ALLOW_LAVA_PLACE(Boolean.class, "allow.lava_place"),
|
|
|
|
ALLOW_TNT_MINECARTS(Boolean.class, "allow.tnt_minecarts"),
|
|
|
|
ALLOW_WATER_PLACE(Boolean.class, "allow.water_place"),
|
2017-11-11 17:09:57 +00:00
|
|
|
ALLOW_REDSTONE(Boolean.class, "allow.redstone"),
|
|
|
|
ALLOW_FIREWORK_EXPLOSION(Boolean.class, "allow.fireworks"),
|
|
|
|
ALLOW_FROSTWALKER(Boolean.class, "allow.frostwalker"),
|
2019-02-22 23:16:08 +00:00
|
|
|
ALLOW_UNSAFE_ENCHANTMENTS(Boolean.class, "allow.unsafe_enchantments"),
|
2019-07-31 04:35:41 +00:00
|
|
|
ALLOW_BELLS(Boolean.class, "allow.bells"),
|
2019-08-27 23:25:50 +00:00
|
|
|
ALLOW_ARMOR_STANDS(Boolean.class, "allow.armorstands"),
|
2019-12-10 00:59:17 +00:00
|
|
|
ALLOW_MINECARTS(Boolean.class, "allow.minecarts"),
|
|
|
|
ALLOW_STRUCTURE_BLOCKS(Boolean.class, "allow.structureblocks"),
|
|
|
|
ALLOW_JIGSAWS(Boolean.class, "allow.jigsaws"),
|
|
|
|
ALLOW_GRINDSTONES(Boolean.class, "allow.grindstones"),
|
|
|
|
ALLOW_JUKEBOXES(Boolean.class, "allow.jukeboxes"),
|
|
|
|
ALLOW_SPAWNERS(Boolean.class, "allow.spawners"),
|
2020-02-09 04:52:43 +00:00
|
|
|
ALLOW_BEEHIVES(Boolean.class, "allow.beehives"),
|
2020-07-02 12:13:20 +00:00
|
|
|
ALLOW_RESPAWN_ANCHORS(Boolean.class, "allow.respawnanchors"),
|
2020-05-29 10:14:21 +00:00
|
|
|
AUTO_TP(Boolean.class, "allow.auto_tp"),
|
|
|
|
AUTO_CLEAR(Boolean.class, "allow.auto_clear"),
|
2021-04-19 07:34:36 +00:00
|
|
|
ALLOW_GRAVITY(Boolean.class, "allow.gravity"),
|
2014-05-16 13:30:02 +00:00
|
|
|
//
|
2017-12-23 04:07:36 +00:00
|
|
|
BLOCKED_CHATCODES(String.class, "blocked_chatcodes"),
|
|
|
|
//
|
2014-05-16 13:30:02 +00:00
|
|
|
MOB_LIMITER_ENABLED(Boolean.class, "moblimiter.enabled"),
|
|
|
|
MOB_LIMITER_MAX(Integer.class, "moblimiter.max"),
|
2014-04-26 11:21:36 +00:00
|
|
|
MOB_LIMITER_DISABLE_DRAGON(Boolean.class, "moblimiter.disable.dragon"),
|
|
|
|
MOB_LIMITER_DISABLE_GHAST(Boolean.class, "moblimiter.disable.ghast"),
|
|
|
|
MOB_LIMITER_DISABLE_GIANT(Boolean.class, "moblimiter.disable.giant"),
|
2014-05-04 21:03:34 +00:00
|
|
|
MOB_LIMITER_DISABLE_SLIME(Boolean.class, "moblimiter.disable.slime"),
|
2014-05-16 13:30:02 +00:00
|
|
|
//
|
2014-05-05 11:30:17 +00:00
|
|
|
HTTPD_ENABLED(Boolean.class, "httpd.enabled"),
|
2020-08-17 22:17:45 +00:00
|
|
|
HTTPD_HOST(String.class, "httpd.host"),
|
2014-05-16 13:30:02 +00:00
|
|
|
HTTPD_PORT(Integer.class, "httpd.port"),
|
|
|
|
HTTPD_PUBLIC_FOLDER(String.class, "httpd.public_folder"),
|
|
|
|
//
|
2014-05-16 13:18:24 +00:00
|
|
|
SERVER_COLORFUL_MOTD(Boolean.class, "server.colorful_motd"),
|
2014-05-16 13:30:02 +00:00
|
|
|
SERVER_NAME(String.class, "server.name"),
|
|
|
|
SERVER_ADDRESS(String.class, "server.address"),
|
|
|
|
SERVER_MOTD(String.class, "server.motd"),
|
2019-12-25 01:05:36 +00:00
|
|
|
SERVER_LOGIN_TITLE(String.class, "server.login_title.title"),
|
|
|
|
SERVER_LOGIN_SUBTITLE(String.class, "server.login_title.subtitle"),
|
2014-05-19 12:21:37 +00:00
|
|
|
SERVER_OWNERS(List.class, "server.owners"),
|
2018-05-13 19:49:13 +00:00
|
|
|
SERVER_EXECUTIVES(List.class, "server.executives"),
|
2021-04-04 12:24:06 +00:00
|
|
|
SERVER_ASSISTANT_EXECUTIVES(List.class, "server.assistant_executives"),
|
2019-04-23 07:36:51 +00:00
|
|
|
SERVER_MASTER_BUILDER_MANAGEMENT(List.class, "server.master_builder_management"),
|
2014-05-16 13:30:02 +00:00
|
|
|
SERVER_BAN_URL(String.class, "server.ban_url"),
|
2020-08-10 00:49:52 +00:00
|
|
|
SERVER_INDEFBAN_URL(String.class, "server.indefban_url"),
|
2019-07-11 02:13:57 +00:00
|
|
|
SERVER_TABLIST_HEADER(String.class, "server.tablist_header"),
|
|
|
|
SERVER_TABLIST_FOOTER(String.class, "server.tablist_footer"),
|
2013-08-17 22:24:40 +00:00
|
|
|
//
|
2020-01-04 23:35:41 +00:00
|
|
|
SERVER_BAN_MOTD(String.class, "server.motds.ban"),
|
2020-12-04 00:28:53 +00:00
|
|
|
SERVER_ADMINMODE_MOTD(String.class, "server.motds.adminmode"),
|
2020-01-04 23:35:41 +00:00
|
|
|
SERVER_LOCKDOWN_MOTD(String.class, "server.motds.lockdown"),
|
|
|
|
SERVER_WHITELIST_MOTD(String.class, "server.motds.whitelist"),
|
|
|
|
SERVER_FULL_MOTD(String.class, "server.motds.full"),
|
|
|
|
//
|
2020-12-08 16:09:26 +00:00
|
|
|
DISCORD_VERIFICATION(Boolean.class, "discord.verification"),
|
2017-12-29 18:12:47 +00:00
|
|
|
DISCORD_TOKEN(String.class, "discord.token"),
|
2019-04-21 00:16:00 +00:00
|
|
|
DISCORD_REPORT_CHANNEL_ID(String.class, "discord.report_channel_id"),
|
2019-11-28 09:08:36 +00:00
|
|
|
DISCORD_CHAT_CHANNEL_ID(String.class, "discord.chat_channel_id"),
|
2020-11-15 02:13:59 +00:00
|
|
|
DISCORD_ADMINCHAT_CHANNEL_ID(String.class, "discord.adminchat_channel_id"),
|
|
|
|
|
2019-04-21 00:16:00 +00:00
|
|
|
DISCORD_ROLE_SYNC(Boolean.class, "discord.role_sync"),
|
|
|
|
DISCORD_SERVER_ID(String.class, "discord.server_id"),
|
2019-11-03 21:40:05 +00:00
|
|
|
DISCORD_MASTER_BUILDER_ROLE_ID(String.class, "discord.master_builder_role_id"),
|
2020-09-28 02:51:15 +00:00
|
|
|
DISCORD_NEW_ADMIN_ROLE_ID(String.class, "discord.admin_role_id"),
|
|
|
|
DISCORD_SENIOR_ADMIN_ROLE_ID(String.class, "discord.senior_admin_role_id"),
|
2019-11-03 21:40:05 +00:00
|
|
|
DISCORD_DEVELOPER_ROLE_ID(String.class, "discord.developer_role_id"),
|
2021-04-26 07:23:24 +00:00
|
|
|
DISCORD_ASSISTANT_EXECUTIVE_ROLE_ID(String.class, "discord.assistant_executive_role_id"),
|
2019-11-03 21:40:05 +00:00
|
|
|
DISCORD_EXECUTIVE_ROLE_ID(String.class, "discord.executive_role_id"),
|
|
|
|
DISCORD_SERVER_OWNER_ROLE_ID(String.class, "discord.server_owner_role_id"),
|
2021-09-03 18:52:15 +00:00
|
|
|
DISCORD_INVITE_LINK(String.class, "discord.invite_link"),
|
2019-11-02 01:28:07 +00:00
|
|
|
//
|
2020-09-14 09:36:25 +00:00
|
|
|
PTERO_URL(String.class, "ptero.url"),
|
|
|
|
PTERO_DEFAULT_EMAIL_DOMAIN(String.class, "ptero.default_email_domain"),
|
|
|
|
PTERO_SERVER_UUID(String.class, "ptero.server_uuid"),
|
|
|
|
PTERO_ADMIN_KEY(String.class, "ptero.admin_key"),
|
|
|
|
PTERO_SERVER_KEY(String.class, "ptero.server_key"),
|
2020-08-08 05:51:09 +00:00
|
|
|
//
|
2019-11-02 01:28:07 +00:00
|
|
|
SHOP_ENABLED(Boolean.class, "shop.enabled"),
|
2020-04-08 02:20:01 +00:00
|
|
|
SHOP_TITLE(String.class, "shop.title"),
|
2019-11-02 01:28:07 +00:00
|
|
|
SHOP_PREFIX(String.class, "shop.prefix"),
|
2020-04-08 02:20:01 +00:00
|
|
|
SHOP_COINS_PER_VOTE(Integer.class, "shop.coins_per_vote"),
|
2020-04-08 08:34:08 +00:00
|
|
|
SHOP_REACTIONS_ENABLED(Boolean.class, "shop.reactions.enabled"),
|
|
|
|
SHOP_REACTIONS_INTERVAL(Integer.class, "shop.reactions.interval"),
|
2020-07-02 08:42:27 +00:00
|
|
|
SHOP_REACTIONS_TIME(Double.class, "shop.reactions.time"),
|
2020-04-08 08:34:08 +00:00
|
|
|
SHOP_REACTIONS_COINS_PER_WIN(Integer.class, "shop.reactions.coins_per_win"),
|
|
|
|
SHOP_REACTIONS_STRING_LENGTH(Integer.class, "shop.reactions.string_length"),
|
2020-10-02 09:27:06 +00:00
|
|
|
SHOP_LOGIN_MESSAGES(List.class, "shop.login_messages"),
|
2020-04-08 02:20:01 +00:00
|
|
|
SHOP_PRICES_GRAPPLING_HOOK(Integer.class, "shop.prices.grappling_hook"),
|
|
|
|
SHOP_PRICES_LIGHTNING_ROD(Integer.class, "shop.prices.lightning_rod"),
|
|
|
|
SHOP_PRICES_FIRE_BALL(Integer.class, "shop.prices.fire_ball"),
|
|
|
|
SHOP_PRICES_RIDEABLE_PEARL(Integer.class, "shop.prices.rideable_pearl"),
|
2020-07-02 08:42:27 +00:00
|
|
|
SHOP_PRICES_STACKING_POTATO(Integer.class, "shop.prices.stacking_potato"),
|
2020-07-09 22:18:29 +00:00
|
|
|
SHOP_PRICES_CLOWN_FISH(Integer.class, "shop.prices.clown_fish"),
|
2020-10-02 09:27:06 +00:00
|
|
|
SHOP_PRICES_LOGIN_MESSAGES(Integer.class, "shop.prices.login_messages"),
|
2021-09-03 19:53:33 +00:00
|
|
|
SHOP_PRICES_RAINBOW_TRAIL(Integer.class, "shop.prices.rainbow_trail"),
|
2017-12-29 18:12:47 +00:00
|
|
|
//
|
2020-12-04 00:28:53 +00:00
|
|
|
ADMINLIST_CLEAN_THESHOLD_HOURS(Integer.class, "adminlist.clean_threshold_hours"),
|
|
|
|
ADMINLIST_CONSOLE_IS_ADMIN(Boolean.class, "adminlist.console_is_admin"),
|
2013-08-17 22:24:40 +00:00
|
|
|
//
|
2019-02-22 23:16:08 +00:00
|
|
|
COREPROTECT_MYSQL_ENABLED(Boolean.class, "coreprotect.enabled"),
|
|
|
|
COREPROTECT_MYSQL_HOST(String.class, "coreprotect.host"),
|
|
|
|
COREPROTECT_MYSQL_PORT(String.class, "coreprotect.port"),
|
|
|
|
COREPROTECT_MYSQL_USERNAME(String.class, "coreprotect.username"),
|
|
|
|
COREPROTECT_MYSQL_PASSWORD(String.class, "coreprotect.password"),
|
|
|
|
COREPROTECT_MYSQL_DATABASE(String.class, "coreprotect.database"),
|
2017-11-11 17:09:57 +00:00
|
|
|
//
|
2014-05-16 13:30:02 +00:00
|
|
|
DISABLE_NIGHT(Boolean.class, "disable.night"),
|
|
|
|
DISABLE_WEATHER(Boolean.class, "disable.weather"),
|
|
|
|
//
|
|
|
|
ENABLE_PREPROCESS_LOG(Boolean.class, "preprocess_log"),
|
|
|
|
ENABLE_PET_PROTECT(Boolean.class, "petprotect.enabled"),
|
|
|
|
//
|
|
|
|
LANDMINES_ENABLED(Boolean.class, "landmines_enabled"),
|
|
|
|
TOSSMOB_ENABLED(Boolean.class, "tossmob_enabled"),
|
|
|
|
AUTOKICK_ENABLED(Boolean.class, "autokick.enabled"),
|
|
|
|
MP44_ENABLED(Boolean.class, "mp44_enabled"),
|
2019-12-10 00:59:17 +00:00
|
|
|
FOURCHAN_ENABLED(Boolean.class, "4chan_enabled"),
|
2014-05-16 13:30:02 +00:00
|
|
|
//
|
|
|
|
NUKE_MONITOR_ENABLED(Boolean.class, "nukemonitor.enabled"),
|
2014-04-26 11:21:36 +00:00
|
|
|
NUKE_MONITOR_COUNT_BREAK(Integer.class, "nukemonitor.count_break"),
|
|
|
|
NUKE_MONITOR_COUNT_PLACE(Integer.class, "nukemonitor.count_place"),
|
2014-05-16 13:30:02 +00:00
|
|
|
NUKE_MONITOR_RANGE(Double.class, "nukemonitor.range"),
|
|
|
|
//
|
|
|
|
AUTOKICK_THRESHOLD(Double.class, "autokick.threshold"),
|
2014-04-26 11:21:36 +00:00
|
|
|
AUTOKICK_TIME(Integer.class, "autokick.time"),
|
2013-08-17 22:24:40 +00:00
|
|
|
//
|
2014-05-04 21:03:34 +00:00
|
|
|
LOGS_SECRET(String.class, "logs.secret"),
|
|
|
|
LOGS_URL(String.class, "logs.url"),
|
2013-08-17 22:24:40 +00:00
|
|
|
//
|
2014-05-16 13:30:02 +00:00
|
|
|
FLATLANDS_GENERATE(Boolean.class, "flatlands.generate"),
|
|
|
|
FLATLANDS_GENERATE_PARAMS(String.class, "flatlands.generate_params"),
|
|
|
|
//
|
2014-08-25 17:49:44 +00:00
|
|
|
ANNOUNCER_ENABLED(Boolean.class, "announcer.enabled"),
|
|
|
|
ANNOUNCER_INTERVAL(Integer.class, "announcer.interval"),
|
|
|
|
ANNOUNCER_PREFIX(String.class, "announcer.prefix"),
|
|
|
|
ANNOUNCER_ANNOUNCEMENTS(List.class, "announcer.announcements"),
|
|
|
|
//
|
2014-05-16 13:30:02 +00:00
|
|
|
EXPLOSIVE_RADIUS(Double.class, "explosive_radius"),
|
|
|
|
FREECAM_TRIGGER_COUNT(Integer.class, "freecam_trigger_count"),
|
|
|
|
SERVICE_CHECKER_URL(String.class, "service_checker_url"),
|
2021-05-09 15:42:31 +00:00
|
|
|
BLOCKED_COMMANDS(List.class, "blocked_commands.global"),
|
|
|
|
MUTED_BLOCKED_COMMANDS(List.class, "blocked_commands.muted"),
|
|
|
|
WILDCARD_BLOCKED_COMMANDS(List.class, "blocked_commands.wildcard"),
|
|
|
|
FORBIDDEN_WORDS(List.class, "forbidden_words"),
|
2013-08-24 19:35:09 +00:00
|
|
|
HOST_SENDER_NAMES(List.class, "host_sender_names"),
|
2016-03-06 15:56:15 +00:00
|
|
|
FAMOUS_PLAYERS(List.class, "famous_players"),
|
2020-12-04 00:28:53 +00:00
|
|
|
ADMIN_ONLY_MODE(Boolean.class, "admin_only_mode"),
|
|
|
|
ADMIN_INFO(List.class, "admininfo"),
|
2020-08-17 22:17:45 +00:00
|
|
|
VOTING_INFO(List.class, "votinginfo"),
|
2019-01-12 03:05:12 +00:00
|
|
|
MASTER_BUILDER_INFO(List.class, "masterbuilderinfo"),
|
2021-08-10 10:13:23 +00:00
|
|
|
FIRST_JOIN_INFO(List.class, "first_join_info.text"),
|
|
|
|
FIRST_JOIN_INFO_ENABLED(Boolean.class, "first_join_info.enabled"),
|
2018-02-22 12:55:04 +00:00
|
|
|
AUTO_ENTITY_WIPE(Boolean.class, "auto_wipe"),
|
2020-08-01 04:10:44 +00:00
|
|
|
TOGGLE_CHAT(Boolean.class, "toggle_chat"),
|
2021-04-22 11:54:29 +00:00
|
|
|
DEVELOPER_MODE(Boolean.class, "developer_mode"),
|
|
|
|
ANTISPAM_MINUTES(Integer.class, "antispam_minutes");
|
2013-08-17 22:24:40 +00:00
|
|
|
//
|
|
|
|
private final Class<?> type;
|
|
|
|
private final String configName;
|
|
|
|
|
2018-03-24 15:41:45 +00:00
|
|
|
ConfigEntry(Class<?> type, String configName)
|
2013-08-17 22:24:40 +00:00
|
|
|
{
|
|
|
|
this.type = type;
|
|
|
|
this.configName = configName;
|
|
|
|
}
|
|
|
|
|
2020-12-25 19:46:43 +00:00
|
|
|
public static ConfigEntry findConfigEntry(String name)
|
|
|
|
{
|
|
|
|
name = name.toLowerCase().replace("_", "");
|
|
|
|
for (ConfigEntry entry : values())
|
|
|
|
{
|
|
|
|
if (entry.toString().toLowerCase().replace("_", "").equals(name))
|
|
|
|
{
|
|
|
|
return entry;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2013-08-17 22:24:40 +00:00
|
|
|
public Class<?> getType()
|
|
|
|
{
|
|
|
|
return type;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String getConfigName()
|
|
|
|
{
|
|
|
|
return configName;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String getString()
|
|
|
|
{
|
2016-05-12 19:40:39 +00:00
|
|
|
return getConfig().getString(this);
|
2013-08-17 22:24:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public Double getDouble()
|
|
|
|
{
|
2016-05-12 19:40:39 +00:00
|
|
|
return getConfig().getDouble(this);
|
2013-08-17 22:24:40 +00:00
|
|
|
}
|
|
|
|
|
2020-12-25 19:46:43 +00:00
|
|
|
public void setDouble(Double value)
|
2013-08-17 22:24:40 +00:00
|
|
|
{
|
2016-05-12 19:40:39 +00:00
|
|
|
getConfig().setDouble(this, value);
|
2013-08-17 22:24:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public Boolean getBoolean()
|
|
|
|
{
|
2016-05-12 19:40:39 +00:00
|
|
|
return getConfig().getBoolean(this);
|
2013-08-17 22:24:40 +00:00
|
|
|
}
|
|
|
|
|
2013-08-18 18:52:46 +00:00
|
|
|
public Boolean setBoolean(Boolean value)
|
2013-08-17 22:24:40 +00:00
|
|
|
{
|
2016-05-12 19:40:39 +00:00
|
|
|
getConfig().setBoolean(this, value);
|
2013-08-18 18:52:46 +00:00
|
|
|
return value;
|
2013-08-17 22:24:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public Integer getInteger()
|
|
|
|
{
|
2016-05-12 19:40:39 +00:00
|
|
|
return getConfig().getInteger(this);
|
2013-08-17 22:24:40 +00:00
|
|
|
}
|
|
|
|
|
2020-12-25 19:46:43 +00:00
|
|
|
public void setInteger(Integer value)
|
2013-08-17 22:24:40 +00:00
|
|
|
{
|
2016-05-12 19:40:39 +00:00
|
|
|
getConfig().setInteger(this, value);
|
2013-08-17 22:24:40 +00:00
|
|
|
}
|
2013-08-28 19:40:14 +00:00
|
|
|
|
2014-03-18 15:07:51 +00:00
|
|
|
public List<?> getList()
|
2013-08-17 22:24:40 +00:00
|
|
|
{
|
2016-05-12 19:40:39 +00:00
|
|
|
return getConfig().getList(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
@SuppressWarnings("unchecked")
|
|
|
|
public List<String> getStringList()
|
|
|
|
{
|
2018-07-31 07:01:29 +00:00
|
|
|
return (List<String>)getList();
|
2016-05-12 19:40:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
private MainConfig getConfig()
|
|
|
|
{
|
2020-12-26 23:54:15 +00:00
|
|
|
return TotalFreedomMod.getPlugin().config;
|
2013-08-17 22:24:40 +00:00
|
|
|
}
|
2017-12-23 04:07:36 +00:00
|
|
|
}
|