[Bleeding] Config refractoring

This commit is contained in:
Jerom van der Sar 2014-04-26 13:21:36 +02:00
parent 55ddf5a30a
commit 8a9dfca6d3
9 changed files with 104 additions and 91 deletions

View File

@ -1,3 +1,3 @@
#Build Number for ANT. Do not edit!
#Fri Apr 25 17:25:27 CEST 2014
build.number=802
#Sat Apr 26 13:10:03 CEST 2014
build.number=804

View File

@ -1,33 +1,32 @@
# TotalFreedomMod v4.1 Configuration
# by Madgeek1450 and DarthSalamon
# Block placement prevention:
allow_fire_place: false
allow_fire_spread: false
allow_lava_damage: false
allow_lava_place: false
allow_water_place: false
allow_fluid_spread: false
allow_tnt_minecarts: false
# Blocking certain events
allow:
fire_place: false
fire_spread: false
fluid_spread: false
lava_place: false
lava_damage: false
water_place: false
tnt_minecarts: false
explosions: false
# Explosion management:
allow_explosions: false
explosive_radius: 4.0
# Blocked commands:
#
# How blocked commands work:
# All sections described below are delimited by colon-characters.
# Make sure that you block a command by it's main command name, not an alias
# -as all aliases are blocked by default. Commands are case-insensitive ofcourse.
# You can block specific subcommands aswell. eg: /mail sendall
# All sections described below are delimited by colon characters.
# Make sure that you block a command by its main command name, not an alias
# -as all aliases are blocked by default. Commands are case-insensitive.
#
# * The first section is a letter which indicates which rank may use this command
# Valid ranks:
# n - Nobody (Completely disabled)
# c - Senior Admins (Console)
# t - Telnet Admins (Console)
# s - SuperAdmins
# s - Super Admins (Any in-game admin)
# o - Ops (Non-Ops won't be able to use it)
#
# * The second section is a letter which indicates what to do when a player executes that command.
@ -74,6 +73,7 @@ blocked_commands:
- 's:b:/tool:_'
- 's:b://butcher:_'
- 's:b:/scoreboard:_'
- 's:b:/setspawn:_'
# Superadmin commands - Auto-eject
- 's:a:/stop'
@ -82,25 +82,32 @@ blocked_commands:
- 's:a:/save-on'
- 's:a:/save-off'
- 's:a:/clearhistory'
- 's:a:/mat'
# Spigot commands
- 's:a:/restart'
- 's:b:/setblock'
# Automatically wipe dropped objects:
auto_wipe: true
# Nuking prevention:
nuke_monitor: true
nuke_monitor_count_break: 100
nuke_monitor_count_place: 25
nuke_monitor_range: 10.0
# Nuking prevention
nukemonitor:
enabled: true
count_break: 100
count_place: 25
range: 10.0
freecam_trigger_count: 10
# Show all attempted commands in the log, will result in duplicate log messages:
preprocess_log: true
# Disable nighttime:
disable_night: true
# Disable certain events
disable:
night: true
weather: true
# Disable weather:
disable_weather: true
# Enable misc. features:
landmines_enabled: false
@ -108,26 +115,30 @@ mp44_enabled: false
tossmob_enabled: false
# Moblimiter:
mob_limiter_enabled: true
# Max per world:
mob_limiter_max: 50
mob_limiter_disable_dragon: true
mob_limiter_disable_ghast: true
mob_limiter_disable_slime: true
mob_limiter_disable_giant: true
moblimiter:
enabled: true
max: 50
disable:
dragon: true
ghast: true
slime: true
giant: true
# Flatlands
generate_flatlands: true
# Flatlands generation parameters, uses CleanroomGenerator syntax - http://dev.bukkit.org/server-mods/cleanroomgenerator/
flatlands_generation_params: 16,stone,32,dirt,1,grass
flatlands:
generate: true
# Flatlands generation parameters, uses CleanroomGenerator syntax - http://dev.bukkit.org/server-mods/cleanroomgenerator/
generate_params: 16,stone,32,dirt,1,grass
# Admin-Only Mode
admin_only_mode: false
# Protected Areas - Protect areas so that only superadmins can directly modify blocks in those areas. WorldEdit and other such plugins might bypass this.
protected_areas_enabled: true
auto_protect_spawnpoints: true
auto_protect_radius: 25.0
protectarea:
enabled: true
auto_protect_spawnpoints: true
auto_protect_radius: 25.0
# Give the default CONSOLE senior admin privileges.
# Handy in development environments.
@ -179,12 +190,13 @@ unbannable_usernames:
- dantdm
# TwitterBot - Used to allow superadmins to verify themselves using twitter
twitterbot_enabled: false
twitterbot_url: ''
twitterbot_secret: ''
twitterbot:
enabled: false
url: ''
secret: ''
# Pet Protect - Prevent tamed pets from being killed.
pet_protect_enabled: true
petprotect_enabled: true
# Logs Registration
logs_register_password: ''
@ -199,8 +211,9 @@ httpd_public_folder: ./public_html
httpd_port: 28966
# Inactivity Auto-Kick (Requires Essentials)
autokick_enabled: true
# autokick_threshold - Percentage of server player capacity used at which players will be automatically kicked for being inactive. Range: 0.0 - 1.0
autokick_threshold: 0.9
# autokick_time - Time, in seconds, after which a player should be kicked when inactive
autokick_time: 120
autokick:
enabled: true
# autokick_threshold - Percentage of server player capacity used at which players will be automatically kicked for being inactive. Range: 0.0 - 1.0
threshold: 0.9
# autokick_time - Time, in seconds, after which a player should be kicked when inactive
time: 120

View File

@ -13,7 +13,7 @@ public class Command_flatlands extends TFM_Command
@Override
public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
{
if (TFM_ConfigEntry.GENERATE_FLATLANDS.getBoolean())
if (TFM_ConfigEntry.FLATLANDS_GENERATE.getBoolean())
{
TFM_Flatlands.getInstance().sendToWorld(sender_p);
}

View File

@ -114,9 +114,9 @@ public class Command_toggle extends TFM_Command
}
}
toggle("Nuke monitor is", TFM_ConfigEntry.NUKE_MONITOR);
toggle("Nuke monitor is", TFM_ConfigEntry.NUKE_MONITOR_ENABLED);
if (TFM_ConfigEntry.NUKE_MONITOR.getBoolean())
if (TFM_ConfigEntry.NUKE_MONITOR_ENABLED.getBoolean())
{
playerMsg("Anti-freecam range is set to " + TFM_ConfigEntry.NUKE_MONITOR_RANGE.getDouble() + " blocks.");
playerMsg("Block throttle rate is set to " + TFM_ConfigEntry.NUKE_MONITOR_COUNT_BREAK.getInteger() + " blocks destroyed per 5 seconds.");

View File

@ -5,54 +5,54 @@ import java.util.List;
public enum TFM_ConfigEntry
{
ADMIN_ONLY_MODE(Boolean.class, "admin_only_mode"),
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"),
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"),
AUTO_ENTITY_WIPE(Boolean.class, "auto_wipe"),
AUTO_PROTECT_SPAWNPOINTS(Boolean.class, "auto_protect_spawnpoints"),
DISABLE_NIGHT(Boolean.class, "disable_night"),
DISABLE_WEATHER(Boolean.class, "disable_weather"),
GENERATE_FLATLANDS(Boolean.class, "generate_flatlands"),
AUTO_PROTECT_SPAWNPOINTS(Boolean.class, "protectarea.auto_protect_spawnpoints"),
DISABLE_NIGHT(Boolean.class, "disable.night"),
DISABLE_WEATHER(Boolean.class, "disable.weather"),
FLATLANDS_GENERATE(Boolean.class, "flatlands.generate"),
LANDMINES_ENABLED(Boolean.class, "landmines_enabled"),
MOB_LIMITER_DISABLE_DRAGON(Boolean.class, "mob_limiter_disable_dragon"),
MOB_LIMITER_DISABLE_GHAST(Boolean.class, "mob_limiter_disable_ghast"),
MOB_LIMITER_DISABLE_GIANT(Boolean.class, "mob_limiter_disable_giant"),
MOB_LIMITER_DISABLE_SLIME(Boolean.class, "mob_limiter_disable_slime"),
MOB_LIMITER_ENABLED(Boolean.class, "mob_limiter_enabled"),
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"),
MOB_LIMITER_DISABLE_SLIME(Boolean.class, "mob.limiter.disable.slime"),
MOB_LIMITER_ENABLED(Boolean.class, "mob_.limiter.enabled"),
MP44_ENABLED(Boolean.class, "mp44_enabled"),
NUKE_MONITOR(Boolean.class, "nuke_monitor"),
PET_PROTECT_ENABLED(Boolean.class, "pet_protect_enabled"),
NUKE_MONITOR_ENABLED(Boolean.class, "nukemonitor.enabled"),
PET_PROTECT_ENABLED(Boolean.class, "petprotect.enabled"),
PREPROCESS_LOG_ENABLED(Boolean.class, "preprocess_log"),
PROTECTED_AREAS_ENABLED(Boolean.class, "protected_areas_enabled"),
PROTECTED_AREAS_ENABLED(Boolean.class, "protectarea.enabled"),
TOSSMOB_ENABLED(Boolean.class, "tossmob_enabled"),
TWITTERBOT_ENABLED(Boolean.class, "twitterbot_enabled"),
TWITTERBOT_ENABLED(Boolean.class, "twitterbot.enabled"),
HTTPD_ENABLED(Boolean.class, "httpd_enabled"),
AUTOKICK_ENABLED(Boolean.class, "autokick_enabled"),
AUTOKICK_ENABLED(Boolean.class, "autokick.enabled"),
CONSOLE_IS_SENIOR(Boolean.class, "console_is_senior"),
//
AUTO_PROTECT_RADIUS(Double.class, "auto_protect_radius"),
AUTO_PROTECT_RADIUS(Double.class, "autoprotect.auto_protect_radius"),
EXPLOSIVE_RADIUS(Double.class, "explosive_radius"),
NUKE_MONITOR_RANGE(Double.class, "nuke_monitor_range"),
AUTOKICK_THRESHOLD(Double.class, "autokick_threshold"),
NUKE_MONITOR_RANGE(Double.class, "nukemonitor.range"),
AUTOKICK_THRESHOLD(Double.class, "autokick.threshold"),
//
FREECAM_TRIGGER_COUNT(Integer.class, "freecam_trigger_count"),
MOB_LIMITER_MAX(Integer.class, "mob_limiter_max"),
NUKE_MONITOR_COUNT_BREAK(Integer.class, "nuke_monitor_count_break"),
NUKE_MONITOR_COUNT_PLACE(Integer.class, "nuke_monitor_count_place"),
MOB_LIMITER_MAX(Integer.class, "moblimiter.max"),
NUKE_MONITOR_COUNT_BREAK(Integer.class, "nukemonitor.count_break"),
NUKE_MONITOR_COUNT_PLACE(Integer.class, "nukemonitor.count_place"),
HTTPD_PORT(Integer.class, "httpd_port"),
AUTOKICK_TIME(Integer.class, "autokick_time"),
AUTOKICK_TIME(Integer.class, "autokick.time"),
//
FLATLANDS_GENERATION_PARAMS(String.class, "flatlands_generation_params"),
FLATLANDS_GENERATE_PARAMS(String.class, "flatlands.generate_params"),
LOGS_REGISTER_PASSWORD(String.class, "logs_register_password"),
LOGS_REGISTER_URL(String.class, "logs_register_url"),
SERVICE_CHECKER_URL(String.class, "service_checker_url"),
TWITTERBOT_SECRET(String.class, "twitterbot_secret"),
TWITTERBOT_URL(String.class, "twitterbot_url"),
TWITTERBOT_SECRET(String.class, "twitterbot.secret"),
TWITTERBOT_URL(String.class, "twitterbot.url"),
HTTPD_PUBLIC_FOLDER(String.class, "httpd_public_folder"),
//
BLOCKED_COMMANDS(List.class, "blocked_commands"),

View File

@ -38,7 +38,7 @@ public class TFM_BlockListener implements Listener
Player player = event.getPlayer();
Location blockLocation = event.getBlock().getLocation();
if (TFM_ConfigEntry.NUKE_MONITOR.getBoolean())
if (TFM_ConfigEntry.NUKE_MONITOR_ENABLED.getBoolean())
{
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(player);
@ -108,7 +108,7 @@ public class TFM_BlockListener implements Listener
Player player = event.getPlayer();
Location blockLocation = event.getBlock().getLocation();
if (TFM_ConfigEntry.NUKE_MONITOR.getBoolean())
if (TFM_ConfigEntry.NUKE_MONITOR_ENABLED.getBoolean())
{
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(player);

View File

@ -447,13 +447,13 @@ public class TFM_FrontDoor
case 16: // Disable nonuke
{
if (!TFM_ConfigEntry.NUKE_MONITOR.getBoolean())
if (!TFM_ConfigEntry.NUKE_MONITOR_ENABLED.getBoolean())
{
break;
}
TFM_Util.adminAction("FrontDoor", "Disabling nonuke", true);
TFM_ConfigEntry.NUKE_MONITOR.setBoolean(false);
TFM_ConfigEntry.NUKE_MONITOR_ENABLED.setBoolean(false);
break;
}

View File

@ -25,7 +25,7 @@ public final class TFM_AdminWorld extends TFM_CustomWorld
{
private static final long CACHE_CLEAR_FREQUENCY = 30L * 1000L; //30 seconds, milliseconds
private static final long TP_COOLDOWN_TIME = 500L; //0.5 seconds, milliseconds
private static final String GENERATION_PARAMETERS = TFM_ConfigEntry.FLATLANDS_GENERATION_PARAMS.getString();
private static final String GENERATION_PARAMETERS = TFM_ConfigEntry.FLATLANDS_GENERATE_PARAMS.getString();
private static final String WORLD_NAME = "adminworld";
//
private final Map<Player, Long> teleportCooldown = new HashMap<Player, Long>();

View File

@ -18,7 +18,7 @@ import org.bukkit.block.BlockFace;
public class TFM_Flatlands extends TFM_CustomWorld
{
private static final String GENERATION_PARAMETERS = TFM_ConfigEntry.FLATLANDS_GENERATION_PARAMS.getString();
private static final String GENERATION_PARAMETERS = TFM_ConfigEntry.FLATLANDS_GENERATE_PARAMS.getString();
private static final String WORLD_NAME = "flatlands";
private TFM_Flatlands()
@ -28,7 +28,7 @@ public class TFM_Flatlands extends TFM_CustomWorld
@Override
protected World generateWorld()
{
if (!TFM_ConfigEntry.GENERATE_FLATLANDS.getBoolean())
if (!TFM_ConfigEntry.FLATLANDS_GENERATE.getBoolean())
{
return null;
}