Add configurability to enforcing the players location.

This commit is contained in:
asofold 2014-03-03 22:52:46 +01:00
parent 2b2ace4a4b
commit ce2d0dbc3c
3 changed files with 6 additions and 1 deletions

View File

@ -140,7 +140,7 @@ public class MovingConfig extends ACheckConfig {
public final boolean vehicleEnforceLocation; public final boolean vehicleEnforceLocation;
public final boolean vehiclePreventDestroyOwn; public final boolean vehiclePreventDestroyOwn;
public final boolean enforceLocation = true; // TODO: Configurable + name. public final boolean enforceLocation;
/** /**
* Instantiates a new moving configuration. * Instantiates a new moving configuration.
@ -219,6 +219,8 @@ public class MovingConfig extends ACheckConfig {
vehicleEnforceLocation = config.getBoolean(ConfPaths.MOVING_VEHICLES_ENFORCELOCATION); vehicleEnforceLocation = config.getBoolean(ConfPaths.MOVING_VEHICLES_ENFORCELOCATION);
vehiclePreventDestroyOwn = config.getBoolean(ConfPaths.MOVING_VEHICLES_PREVENTDESTROYOWN); vehiclePreventDestroyOwn = config.getBoolean(ConfPaths.MOVING_VEHICLES_PREVENTDESTROYOWN);
enforceLocation = config.getBoolean(ConfPaths.MOVING_ENFORCELOCATION);
} }

View File

@ -567,11 +567,13 @@ public abstract class ConfPaths {
public static final String MOVING_SPRINTINGGRACE = MOVING + "sprintinggrace"; public static final String MOVING_SPRINTINGGRACE = MOVING + "sprintinggrace";
public static final String MOVING_ASSUMESPRINT = MOVING + "assumesprint"; public static final String MOVING_ASSUMESPRINT = MOVING + "assumesprint";
public static final String MOVING_SPEEDGRACE = MOVING + "speedgrace"; public static final String MOVING_SPEEDGRACE = MOVING + "speedgrace";
public static final String MOVING_ENFORCELOCATION = MOVING + "enforcelocation";
private static final String MOVING_VEHICLES = MOVING + "vehicles."; private static final String MOVING_VEHICLES = MOVING + "vehicles.";
public static final String MOVING_VEHICLES_ENFORCELOCATION = MOVING_VEHICLES + "enforcelocation"; public static final String MOVING_VEHICLES_ENFORCELOCATION = MOVING_VEHICLES + "enforcelocation";
public static final String MOVING_VEHICLES_PREVENTDESTROYOWN = MOVING_VEHICLES + "preventdestroyown"; public static final String MOVING_VEHICLES_PREVENTDESTROYOWN = MOVING_VEHICLES + "preventdestroyown";
public static final String STRINGS = "strings"; public static final String STRINGS = "strings";
// Compatibility section (possibly temporary). // Compatibility section (possibly temporary).

View File

@ -409,6 +409,7 @@ public class DefaultConfig extends ConfigFile {
set(ConfPaths.MOVING_SPRINTINGGRACE, 2.0); set(ConfPaths.MOVING_SPRINTINGGRACE, 2.0);
set(ConfPaths.MOVING_ASSUMESPRINT, true); set(ConfPaths.MOVING_ASSUMESPRINT, true);
set(ConfPaths.MOVING_SPEEDGRACE, 4.0); set(ConfPaths.MOVING_SPEEDGRACE, 4.0);
set(ConfPaths.MOVING_ENFORCELOCATION, true);
// TODO: An extra file might suit these. // TODO: An extra file might suit these.
final String start = "[player] failed [check]: "; final String start = "[player] failed [check]: ";