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-11-03 21:40:05 +00:00
|
|
|
ALLOW_MINECARTS (Boolean.class, "allow.minecarts"),
|
2019-11-03 14:10:56 +00:00
|
|
|
ALLOW_CLEAR_ON_JOIN(Boolean.class, "allow.clearonjoin"),
|
2019-11-18 21:45:18 +00:00
|
|
|
ALLOW_TPR_ON_JOIN(Boolean.class, "allow.tpronjoin"),
|
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"),
|
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"),
|
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"),
|
2019-11-24 18:56:32 +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"),
|
|
|
|
SERVER_PERMBAN_URL(String.class, "server.permban_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
|
|
|
//
|
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"),
|
|
|
|
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"),
|
2019-04-21 00:16:00 +00:00
|
|
|
DISCORD_SUPER_ROLE_ID(String.class, "discord.super_role_id"),
|
|
|
|
DISCORD_TELNET_ROLE_ID(String.class, "discord.telnet_role_id"),
|
|
|
|
DISCORD_SENIOR_ROLE_ID(String.class, "discord.senior_role_id"),
|
2019-11-03 21:40:05 +00:00
|
|
|
DISCORD_DEVELOPER_ROLE_ID(String.class, "discord.developer_role_id"),
|
|
|
|
DISCORD_EXECUTIVE_ROLE_ID(String.class, "discord.executive_role_id"),
|
|
|
|
DISCORD_SERVER_OWNER_ROLE_ID(String.class, "discord.server_owner_role_id"),
|
2019-11-02 01:28:07 +00:00
|
|
|
//
|
|
|
|
SHOP_ENABLED(Boolean.class, "shop.enabled"),
|
|
|
|
SHOP_PREFIX(String.class, "shop.prefix"),
|
2017-12-29 18:12:47 +00:00
|
|
|
//
|
2016-03-02 19:28:01 +00:00
|
|
|
ADMINLIST_CLEAN_THESHOLD_HOURS(Integer.class, "adminlist.clean_threshold_hours"),
|
|
|
|
ADMINLIST_CONSOLE_IS_SENIOR(Boolean.class, "adminlist.console_is_senior"),
|
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"),
|
|
|
|
//
|
|
|
|
PROTECTAREA_ENABLED(Boolean.class, "protectarea.enabled"),
|
|
|
|
PROTECTAREA_SPAWNPOINTS(Boolean.class, "protectarea.auto_protect_spawnpoints"),
|
|
|
|
PROTECTAREA_RADIUS(Double.class, "protectarea.auto_protect_radius"),
|
|
|
|
//
|
|
|
|
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"),
|
2013-08-17 22:24:40 +00:00
|
|
|
BLOCKED_COMMANDS(List.class, "blocked_commands"),
|
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"),
|
2014-10-30 18:44:05 +00:00
|
|
|
NOADMIN_IPS(List.class, "noadmin_ips"),
|
2014-05-16 13:30:02 +00:00
|
|
|
ADMIN_ONLY_MODE(Boolean.class, "admin_only_mode"),
|
2019-01-12 03:05:12 +00:00
|
|
|
ADMIN_INFO(List.class, "admininfo"),
|
2019-08-19 01:06:47 +00:00
|
|
|
VOTING_INFO(List.class, "votinginfo"),
|
2019-01-12 03:05:12 +00:00
|
|
|
MASTER_BUILDER_INFO(List.class, "masterbuilderinfo"),
|
2018-02-22 12:55:04 +00:00
|
|
|
AUTO_ENTITY_WIPE(Boolean.class, "auto_wipe"),
|
|
|
|
//
|
|
|
|
AMP_ENABLED(Boolean.class, "amp.enabled"),
|
|
|
|
AMP_USERNAME(String.class, "amp.username"),
|
|
|
|
AMP_PASSWORD(String.class, "amp.password"),
|
|
|
|
AMP_URL(String.class, "amp.url");
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
2013-08-18 18:52:46 +00:00
|
|
|
public String setString(String value)
|
2013-08-17 22:24:40 +00:00
|
|
|
{
|
2016-05-12 19:40:39 +00:00
|
|
|
getConfig().setString(this, value);
|
2013-08-18 18:52:46 +00:00
|
|
|
return value;
|
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
|
|
|
}
|
|
|
|
|
2013-08-18 18:52:46 +00:00
|
|
|
public Double 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-18 18:52:46 +00:00
|
|
|
return 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
|
|
|
}
|
|
|
|
|
2013-08-18 18:52:46 +00:00
|
|
|
public Integer 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-18 18:52:46 +00:00
|
|
|
return 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()
|
|
|
|
{
|
|
|
|
return TotalFreedomMod.plugin().config;
|
2013-08-17 22:24:40 +00:00
|
|
|
}
|
2013-09-08 02:10:05 +00:00
|
|
|
|
2015-10-19 17:43:46 +00:00
|
|
|
public static ConfigEntry findConfigEntry(String name)
|
2013-09-08 02:10:05 +00:00
|
|
|
{
|
|
|
|
name = name.toLowerCase().replace("_", "");
|
2015-10-19 17:43:46 +00:00
|
|
|
for (ConfigEntry entry : values())
|
2013-09-08 02:10:05 +00:00
|
|
|
{
|
|
|
|
if (entry.toString().toLowerCase().replace("_", "").equals(name))
|
|
|
|
{
|
|
|
|
return entry;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
2017-12-23 04:07:36 +00:00
|
|
|
}
|