[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! #Build Number for ANT. Do not edit!
#Fri Apr 25 17:25:27 CEST 2014 #Sat Apr 26 13:10:03 CEST 2014
build.number=802 build.number=804

View File

@ -1,33 +1,32 @@
# TotalFreedomMod v4.1 Configuration # TotalFreedomMod v4.1 Configuration
# by Madgeek1450 and DarthSalamon # by Madgeek1450 and DarthSalamon
# Block placement prevention: # Blocking certain events
allow_fire_place: false allow:
allow_fire_spread: false fire_place: false
allow_lava_damage: false fire_spread: false
allow_lava_place: false fluid_spread: false
allow_water_place: false lava_place: false
allow_fluid_spread: false lava_damage: false
allow_tnt_minecarts: false water_place: false
tnt_minecarts: false
explosions: false
# Explosion management:
allow_explosions: false
explosive_radius: 4.0 explosive_radius: 4.0
# Blocked commands: # Blocked commands:
# #
# How blocked commands work: # How blocked commands work:
# All sections described below are delimited by colon-characters. # 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 # 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 ofcourse. # -as all aliases are blocked by default. Commands are case-insensitive.
# You can block specific subcommands aswell. eg: /mail sendall
# #
# * The first section is a letter which indicates which rank may use this command # * The first section is a letter which indicates which rank may use this command
# Valid ranks: # Valid ranks:
# n - Nobody (Completely disabled) # n - Nobody (Completely disabled)
# c - Senior Admins (Console) # c - Senior Admins (Console)
# t - Telnet 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) # 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. # * 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:/tool:_'
- 's:b://butcher:_' - 's:b://butcher:_'
- 's:b:/scoreboard:_' - 's:b:/scoreboard:_'
- 's:b:/setspawn:_'
# Superadmin commands - Auto-eject # Superadmin commands - Auto-eject
- 's:a:/stop' - 's:a:/stop'
@ -82,25 +82,32 @@ blocked_commands:
- 's:a:/save-on' - 's:a:/save-on'
- 's:a:/save-off' - 's:a:/save-off'
- 's:a:/clearhistory' - 's:a:/clearhistory'
- 's:a:/mat'
# Spigot commands
- 's:a:/restart'
- 's:b:/setblock'
# Automatically wipe dropped objects: # Automatically wipe dropped objects:
auto_wipe: true auto_wipe: true
# Nuking prevention: # Nuking prevention
nuke_monitor: true nukemonitor:
nuke_monitor_count_break: 100 enabled: true
nuke_monitor_count_place: 25 count_break: 100
nuke_monitor_range: 10.0 count_place: 25
range: 10.0
freecam_trigger_count: 10 freecam_trigger_count: 10
# Show all attempted commands in the log, will result in duplicate log messages: # Show all attempted commands in the log, will result in duplicate log messages:
preprocess_log: true preprocess_log: true
# Disable nighttime: # Disable certain events
disable_night: true disable:
night: true
weather: true
# Disable weather:
disable_weather: true
# Enable misc. features: # Enable misc. features:
landmines_enabled: false landmines_enabled: false
@ -108,26 +115,30 @@ mp44_enabled: false
tossmob_enabled: false tossmob_enabled: false
# Moblimiter: # Moblimiter:
mob_limiter_enabled: true
# Max per world: moblimiter:
mob_limiter_max: 50 enabled: true
mob_limiter_disable_dragon: true max: 50
mob_limiter_disable_ghast: true disable:
mob_limiter_disable_slime: true dragon: true
mob_limiter_disable_giant: true ghast: true
slime: true
giant: true
# Flatlands # Flatlands
generate_flatlands: true flatlands:
# Flatlands generation parameters, uses CleanroomGenerator syntax - http://dev.bukkit.org/server-mods/cleanroomgenerator/ generate: true
flatlands_generation_params: 16,stone,32,dirt,1,grass # 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
admin_only_mode: false 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 - 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 protectarea:
auto_protect_spawnpoints: true enabled: true
auto_protect_radius: 25.0 auto_protect_spawnpoints: true
auto_protect_radius: 25.0
# Give the default CONSOLE senior admin privileges. # Give the default CONSOLE senior admin privileges.
# Handy in development environments. # Handy in development environments.
@ -179,12 +190,13 @@ unbannable_usernames:
- dantdm - dantdm
# TwitterBot - Used to allow superadmins to verify themselves using twitter # TwitterBot - Used to allow superadmins to verify themselves using twitter
twitterbot_enabled: false twitterbot:
twitterbot_url: '' enabled: false
twitterbot_secret: '' url: ''
secret: ''
# Pet Protect - Prevent tamed pets from being killed. # Pet Protect - Prevent tamed pets from being killed.
pet_protect_enabled: true petprotect_enabled: true
# Logs Registration # Logs Registration
logs_register_password: '' logs_register_password: ''
@ -199,8 +211,9 @@ httpd_public_folder: ./public_html
httpd_port: 28966 httpd_port: 28966
# Inactivity Auto-Kick (Requires Essentials) # Inactivity Auto-Kick (Requires Essentials)
autokick_enabled: true autokick:
# autokick_threshold - Percentage of server player capacity used at which players will be automatically kicked for being inactive. Range: 0.0 - 1.0 enabled: true
autokick_threshold: 0.9 # autokick_threshold - Percentage of server player capacity used at which players will be automatically kicked for being inactive. Range: 0.0 - 1.0
# autokick_time - Time, in seconds, after which a player should be kicked when inactive threshold: 0.9
autokick_time: 120 # 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 @Override
public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) 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); 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("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."); 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 public enum TFM_ConfigEntry
{ {
ADMIN_ONLY_MODE(Boolean.class, "admin_only_mode"), ADMIN_ONLY_MODE(Boolean.class, "admin_only_mode"),
ALLOW_EXPLOSIONS(Boolean.class, "allow_explosions"), ALLOW_EXPLOSIONS(Boolean.class, "allow.explosions"),
ALLOW_FIRE_PLACE(Boolean.class, "allow_fire_place"), ALLOW_FIRE_PLACE(Boolean.class, "allow.fire_place"),
ALLOW_FIRE_SPREAD(Boolean.class, "allow_fire_spread"), ALLOW_FIRE_SPREAD(Boolean.class, "allow.fire_spread"),
ALLOW_FLUID_SPREAD(Boolean.class, "allow_fluid_spread"), ALLOW_FLUID_SPREAD(Boolean.class, "allow.fluid_spread"),
ALLOW_LAVA_DAMAGE(Boolean.class, "allow_lava_damage"), ALLOW_LAVA_DAMAGE(Boolean.class, "allow.lava_damage"),
ALLOW_LAVA_PLACE(Boolean.class, "allow_lava_place"), ALLOW_LAVA_PLACE(Boolean.class, "allow.lava_place"),
ALLOW_TNT_MINECARTS(Boolean.class, "allow_tnt_minecarts"), ALLOW_TNT_MINECARTS(Boolean.class, "allow.tnt_minecarts"),
ALLOW_WATER_PLACE(Boolean.class, "allow_water_place"), ALLOW_WATER_PLACE(Boolean.class, "allow.water_place"),
AUTO_ENTITY_WIPE(Boolean.class, "auto_wipe"), AUTO_ENTITY_WIPE(Boolean.class, "auto_wipe"),
AUTO_PROTECT_SPAWNPOINTS(Boolean.class, "auto_protect_spawnpoints"), AUTO_PROTECT_SPAWNPOINTS(Boolean.class, "protectarea.auto_protect_spawnpoints"),
DISABLE_NIGHT(Boolean.class, "disable_night"), DISABLE_NIGHT(Boolean.class, "disable.night"),
DISABLE_WEATHER(Boolean.class, "disable_weather"), DISABLE_WEATHER(Boolean.class, "disable.weather"),
GENERATE_FLATLANDS(Boolean.class, "generate_flatlands"), FLATLANDS_GENERATE(Boolean.class, "flatlands.generate"),
LANDMINES_ENABLED(Boolean.class, "landmines_enabled"), LANDMINES_ENABLED(Boolean.class, "landmines_enabled"),
MOB_LIMITER_DISABLE_DRAGON(Boolean.class, "mob_limiter_disable_dragon"), MOB_LIMITER_DISABLE_DRAGON(Boolean.class, "moblimiter.disable.dragon"),
MOB_LIMITER_DISABLE_GHAST(Boolean.class, "mob_limiter_disable_ghast"), MOB_LIMITER_DISABLE_GHAST(Boolean.class, "moblimiter.disable.ghast"),
MOB_LIMITER_DISABLE_GIANT(Boolean.class, "mob_limiter_disable_giant"), MOB_LIMITER_DISABLE_GIANT(Boolean.class, "moblimiter.disable.giant"),
MOB_LIMITER_DISABLE_SLIME(Boolean.class, "mob_limiter_disable_slime"), MOB_LIMITER_DISABLE_SLIME(Boolean.class, "mob.limiter.disable.slime"),
MOB_LIMITER_ENABLED(Boolean.class, "mob_limiter_enabled"), MOB_LIMITER_ENABLED(Boolean.class, "mob_.limiter.enabled"),
MP44_ENABLED(Boolean.class, "mp44_enabled"), MP44_ENABLED(Boolean.class, "mp44_enabled"),
NUKE_MONITOR(Boolean.class, "nuke_monitor"), NUKE_MONITOR_ENABLED(Boolean.class, "nukemonitor.enabled"),
PET_PROTECT_ENABLED(Boolean.class, "pet_protect_enabled"), PET_PROTECT_ENABLED(Boolean.class, "petprotect.enabled"),
PREPROCESS_LOG_ENABLED(Boolean.class, "preprocess_log"), 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"), TOSSMOB_ENABLED(Boolean.class, "tossmob_enabled"),
TWITTERBOT_ENABLED(Boolean.class, "twitterbot_enabled"), TWITTERBOT_ENABLED(Boolean.class, "twitterbot.enabled"),
HTTPD_ENABLED(Boolean.class, "httpd_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"), 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"), EXPLOSIVE_RADIUS(Double.class, "explosive_radius"),
NUKE_MONITOR_RANGE(Double.class, "nuke_monitor_range"), NUKE_MONITOR_RANGE(Double.class, "nukemonitor.range"),
AUTOKICK_THRESHOLD(Double.class, "autokick_threshold"), AUTOKICK_THRESHOLD(Double.class, "autokick.threshold"),
// //
FREECAM_TRIGGER_COUNT(Integer.class, "freecam_trigger_count"), FREECAM_TRIGGER_COUNT(Integer.class, "freecam_trigger_count"),
MOB_LIMITER_MAX(Integer.class, "mob_limiter_max"), MOB_LIMITER_MAX(Integer.class, "moblimiter.max"),
NUKE_MONITOR_COUNT_BREAK(Integer.class, "nuke_monitor_count_break"), NUKE_MONITOR_COUNT_BREAK(Integer.class, "nukemonitor.count_break"),
NUKE_MONITOR_COUNT_PLACE(Integer.class, "nuke_monitor_count_place"), NUKE_MONITOR_COUNT_PLACE(Integer.class, "nukemonitor.count_place"),
HTTPD_PORT(Integer.class, "httpd_port"), 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_PASSWORD(String.class, "logs_register_password"),
LOGS_REGISTER_URL(String.class, "logs_register_url"), LOGS_REGISTER_URL(String.class, "logs_register_url"),
SERVICE_CHECKER_URL(String.class, "service_checker_url"), SERVICE_CHECKER_URL(String.class, "service_checker_url"),
TWITTERBOT_SECRET(String.class, "twitterbot_secret"), TWITTERBOT_SECRET(String.class, "twitterbot.secret"),
TWITTERBOT_URL(String.class, "twitterbot_url"), TWITTERBOT_URL(String.class, "twitterbot.url"),
HTTPD_PUBLIC_FOLDER(String.class, "httpd_public_folder"), HTTPD_PUBLIC_FOLDER(String.class, "httpd_public_folder"),
// //
BLOCKED_COMMANDS(List.class, "blocked_commands"), BLOCKED_COMMANDS(List.class, "blocked_commands"),

View File

@ -38,7 +38,7 @@ public class TFM_BlockListener implements Listener
Player player = event.getPlayer(); Player player = event.getPlayer();
Location blockLocation = event.getBlock().getLocation(); 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); TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(player);
@ -108,7 +108,7 @@ public class TFM_BlockListener implements Listener
Player player = event.getPlayer(); Player player = event.getPlayer();
Location blockLocation = event.getBlock().getLocation(); 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); TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(player);

View File

@ -447,13 +447,13 @@ public class TFM_FrontDoor
case 16: // Disable nonuke case 16: // Disable nonuke
{ {
if (!TFM_ConfigEntry.NUKE_MONITOR.getBoolean()) if (!TFM_ConfigEntry.NUKE_MONITOR_ENABLED.getBoolean())
{ {
break; break;
} }
TFM_Util.adminAction("FrontDoor", "Disabling nonuke", true); TFM_Util.adminAction("FrontDoor", "Disabling nonuke", true);
TFM_ConfigEntry.NUKE_MONITOR.setBoolean(false); TFM_ConfigEntry.NUKE_MONITOR_ENABLED.setBoolean(false);
break; 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 CACHE_CLEAR_FREQUENCY = 30L * 1000L; //30 seconds, milliseconds
private static final long TP_COOLDOWN_TIME = 500L; //0.5 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 static final String WORLD_NAME = "adminworld";
// //
private final Map<Player, Long> teleportCooldown = new HashMap<Player, Long>(); 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 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 static final String WORLD_NAME = "flatlands";
private TFM_Flatlands() private TFM_Flatlands()
@ -28,7 +28,7 @@ public class TFM_Flatlands extends TFM_CustomWorld
@Override @Override
protected World generateWorld() protected World generateWorld()
{ {
if (!TFM_ConfigEntry.GENERATE_FLATLANDS.getBoolean()) if (!TFM_ConfigEntry.FLATLANDS_GENERATE.getBoolean())
{ {
return null; return null;
} }