[BLEEDING] Re-sharpen NoFall, configurable.

Fall damage events for violations are not cancelled anymore due to the
"moved too quickly" bypass. Instead the player is dealt 3 more damage
than normal and added to the hover checking if that is activated.
Further a config flag allows to specify if to reset the NoFall data, set
to false by default, thus victims of Minecraft false-positives are at
doubled suffering.
punished
This commit is contained in:
asofold 2013-01-24 23:49:31 +01:00
parent 940e7d83e3
commit 85131dcadb
4 changed files with 18 additions and 4 deletions

View File

@ -79,7 +79,11 @@ public class MovingConfig extends ACheckConfig {
public final ActionList morePacketsVehicleActions;
public final boolean noFallCheck;
/** Deal damage instead of Minecraft, whenever a player is judged to be on ground. */
public final boolean noFallDealDamage;
/** Reset data on violation, i.e. a player taking fall damage without being on ground. */
public final boolean noFallViolationReset;
/** Reset data on tp. */
public final boolean noFallTpReset;
public final ActionList noFallActions;
@ -136,6 +140,7 @@ public class MovingConfig extends ACheckConfig {
noFallCheck = data.getBoolean(ConfPaths.MOVING_NOFALL_CHECK);
noFallDealDamage = data.getBoolean(ConfPaths.MOVING_NOFALL_DEALDAMAGE);
noFallViolationReset = data.getBoolean(ConfPaths.MOVING_NOFALL_RESETONVL);
noFallTpReset = data.getBoolean(ConfPaths.MOVING_NOFALL_RESETONTP);
noFallActions = data.getOptimizedActionList(ConfPaths.MOVING_NOFALL_ACTIONS, Permissions.MOVING_NOFALL);

View File

@ -367,6 +367,7 @@ public class MovingListener extends CheckListener implements TickListener, IRemo
// Ignore players in vehicles.
if (player.isInsideVehicle()){
System.out.println("VEHICLE ");
// Workaround for pigs !
final Entity vehicle = player.getVehicle();
if (vehicle != null && (vehicle instanceof Pig)){
@ -374,7 +375,7 @@ public class MovingListener extends CheckListener implements TickListener, IRemo
}
return;
}
System.out.println("NORMAL");
// Ignore dead players.
if (player.isDead()) return;
@ -945,9 +946,15 @@ public class MovingListener extends CheckListener implements TickListener, IRemo
}
else{
// Minecraft/NCP bug or cheating.
// Cancel the event, apply damage later.
event.setCancelled(true);
// TODO: Add player to hover checks ?.
// (Do not cancel the event, otherwise: "moved too quickly exploit".)
if (cc.noFallViolationReset){
data.clearNoFallData();
}
// Add player to hover checks.
if (cc.sfHoverCheck && data.sfHoverTicks < 0){
data.sfHoverTicks = 0;
hoverTicks.add(player.getName());
}
}
// Entity fall-distance should be reset elsewhere.
}

View File

@ -475,6 +475,7 @@ public abstract class ConfPaths {
private static final String MOVING_NOFALL = MOVING + "nofall.";
public static final String MOVING_NOFALL_CHECK = MOVING_NOFALL + "active";
public static final String MOVING_NOFALL_DEALDAMAGE = MOVING_NOFALL + "dealdamage";
public static final String MOVING_NOFALL_RESETONVL = MOVING_NOFALL + "resetonviolation";
public static final String MOVING_NOFALL_RESETONTP = MOVING_NOFALL + "resetonteleport";
public static final String MOVING_NOFALL_ACTIONS = MOVING_NOFALL + "actions";

View File

@ -371,6 +371,7 @@ public class DefaultConfig extends ConfigFile {
set(ConfPaths.MOVING_NOFALL_CHECK, true);
set(ConfPaths.MOVING_NOFALL_DEALDAMAGE, true);
set(ConfPaths.MOVING_NOFALL_RESETONVL, false);
set(ConfPaths.MOVING_NOFALL_RESETONTP, false);
set(ConfPaths.MOVING_NOFALL_ACTIONS, "log:nofall:0:5:if cancel vl>30 log:nofall:0:5:icf cancel");