Add falldamage option to survivalfly. Not sure it is a good idea to set

it to false, though.
This commit is contained in:
asofold 2013-02-02 22:22:55 +01:00
parent 044c435180
commit ddd61a6522
4 changed files with 7 additions and 3 deletions

View File

@ -100,6 +100,7 @@ public class MovingConfig extends ACheckConfig {
public final boolean survivalFlyCobwebHack; public final boolean survivalFlyCobwebHack;
public final boolean survivalFlyAccountingH; public final boolean survivalFlyAccountingH;
public final boolean survivalFlyAccountingV; public final boolean survivalFlyAccountingV;
public final boolean sfFallDamage;
public final long survivalFlyVLFreeze; public final long survivalFlyVLFreeze;
public final ActionList survivalFlyActions; public final ActionList survivalFlyActions;
@ -158,6 +159,7 @@ public class MovingConfig extends ACheckConfig {
survivalFlyCobwebHack = data.getBoolean(ConfPaths.MOVING_SURVIVALFLY_COBWEBHACK, true); survivalFlyCobwebHack = data.getBoolean(ConfPaths.MOVING_SURVIVALFLY_COBWEBHACK, true);
survivalFlyAccountingH = data.getBoolean(ConfPaths.MOVING_SURVIVALFLY_EXTENDED_HACC, false); survivalFlyAccountingH = data.getBoolean(ConfPaths.MOVING_SURVIVALFLY_EXTENDED_HACC, false);
survivalFlyAccountingV = data.getBoolean(ConfPaths.MOVING_SURVIVALFLY_EXTENDED_VACC); survivalFlyAccountingV = data.getBoolean(ConfPaths.MOVING_SURVIVALFLY_EXTENDED_VACC);
sfFallDamage = data.getBoolean(ConfPaths.MOVING_SURVIVALFLY_FALLDAMAGE);
survivalFlyVLFreeze = data.getLong(ConfPaths.MOVING_SURVIVALFLY_VLFREEZE, 2000L); survivalFlyVLFreeze = data.getLong(ConfPaths.MOVING_SURVIVALFLY_VLFREEZE, 2000L);
survivalFlyActions = data.getOptimizedActionList(ConfPaths.MOVING_SURVIVALFLY_ACTIONS, Permissions.MOVING_SURVIVALFLY); survivalFlyActions = data.getOptimizedActionList(ConfPaths.MOVING_SURVIVALFLY_ACTIONS, Permissions.MOVING_SURVIVALFLY);

View File

@ -343,7 +343,7 @@ public class MovingListener extends CheckListener implements TickListener, IRemo
} }
if (target != null){ if (target != null){
// Actually this should not possibly be null, this is a block for "future" purpose, feel free to criticize it. // Actually this should not possibly be null, this is a block for "future" purpose, feel free to criticize it.
if (sfCheck && noFall.isEnabled(player)){ if (sfCheck && cc.sfFallDamage && noFall.isEnabled(player)){
// Check if to deal damage. // Check if to deal damage.
double y = loc.getY(); double y = loc.getY();
if (data.hasSetBack()) y = Math.min(y, data.getSetBackY()); if (data.hasSetBack()) y = Math.min(y, data.getSetBackY());
@ -570,7 +570,7 @@ public class MovingListener extends CheckListener implements TickListener, IRemo
if (passableTo != null){ if (passableTo != null){
// Deal damage if necessary. // Deal damage if necessary.
// Leaving out: player.getLocation().getY() // Leaving out: player.getLocation().getY()
noFall.checkDamage(player, data, Math.min(from.getY(), to.getY())); if (cc.sfFallDamage) noFall.checkDamage(player, data, Math.min(from.getY(), to.getY()));
} }
else if (newTo == null) { else if (newTo == null) {
// NOTE: noFall might set yOnGround for the positions. // NOTE: noFall might set yOnGround for the positions.
@ -579,7 +579,7 @@ public class MovingListener extends CheckListener implements TickListener, IRemo
else{ else{
// Deal damage if necessary. // Deal damage if necessary.
// Leaving out: player.getLocation().getY() // Leaving out: player.getLocation().getY()
noFall.checkDamage(player, data, Math.min(from.getY(), to.getY())); if (cc.sfFallDamage) noFall.checkDamage(player, data, Math.min(from.getY(), to.getY()));
} }
} }
} }

View File

@ -495,6 +495,7 @@ public abstract class ConfPaths {
private static final String MOVING_SURVIVALFLY_EXTENDED = MOVING_SURVIVALFLY + "extended."; private static final String MOVING_SURVIVALFLY_EXTENDED = MOVING_SURVIVALFLY + "extended.";
public static final String MOVING_SURVIVALFLY_EXTENDED_HACC = MOVING_SURVIVALFLY_EXTENDED + "horizontal-accounting"; public static final String MOVING_SURVIVALFLY_EXTENDED_HACC = MOVING_SURVIVALFLY_EXTENDED + "horizontal-accounting";
public static final String MOVING_SURVIVALFLY_EXTENDED_VACC = MOVING_SURVIVALFLY_EXTENDED + "vertical-accounting"; public static final String MOVING_SURVIVALFLY_EXTENDED_VACC = MOVING_SURVIVALFLY_EXTENDED + "vertical-accounting";
public static final String MOVING_SURVIVALFLY_FALLDAMAGE = MOVING_SURVIVALFLY + "falldamage";
public static final String MOVING_SURVIVALFLY_VLFREEZE = MOVING_SURVIVALFLY + "vlfreeze"; public static final String MOVING_SURVIVALFLY_VLFREEZE = MOVING_SURVIVALFLY + "vlfreeze";
public static final String MOVING_SURVIVALFLY_ACTIONS = MOVING_SURVIVALFLY + "actions"; public static final String MOVING_SURVIVALFLY_ACTIONS = MOVING_SURVIVALFLY + "actions";

View File

@ -381,6 +381,7 @@ public class DefaultConfig extends ConfigFile {
set(ConfPaths.MOVING_SURVIVALFLY_CHECK, true); set(ConfPaths.MOVING_SURVIVALFLY_CHECK, true);
// set(ConfPaths.MOVING_SURVIVALFLY_EXTENDED_HACC, false); // set(ConfPaths.MOVING_SURVIVALFLY_EXTENDED_HACC, false);
set(ConfPaths.MOVING_SURVIVALFLY_EXTENDED_VACC, true); set(ConfPaths.MOVING_SURVIVALFLY_EXTENDED_VACC, true);
set(ConfPaths.MOVING_SURVIVALFLY_FALLDAMAGE, true);
// The settings aren't enabled by default. Simply write them yourself in the configuration file. // The settings aren't enabled by default. Simply write them yourself in the configuration file.
// set(ConfPaths.MOVING_SURVIVALFLY_BLOCKINGSPEED, 100); // set(ConfPaths.MOVING_SURVIVALFLY_BLOCKINGSPEED, 100);
// set(ConfPaths.MOVING_SURVIVALFLY_SNEAKINGSPEED, 100); // set(ConfPaths.MOVING_SURVIVALFLY_SNEAKINGSPEED, 100);