diff --git a/Instructions.txt b/Instructions.txt index 41c610fa..0ebf077b 100644 --- a/Instructions.txt +++ b/Instructions.txt @@ -147,6 +147,9 @@ checks: checknofall: Should players be checked for a common type of "nofall" hack, that allows them to avoid taking damage when falling. + nofallaggressivemode: + Enable improved version of nofall check, that will catch additional types of + "nofall" hacks and deal damage to players directly (experimental). nofallactions: What should happen if a player is considered to be using a "nofall" hack. Default is to log a message and encourage Bukkit to deal fall damage anyway ("cancel" the diff --git a/pom.xml b/pom.xml index 26a4c0b6..6592ec11 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 cc.co.evenprime.bukkit NoCheat - 3.0.2 + 3.1.0 jar NoCheat diff --git a/src/cc/co/evenprime/bukkit/nocheat/checks/moving/MovingConfig.java b/src/cc/co/evenprime/bukkit/nocheat/checks/moving/MovingConfig.java index 76e20a77..6396e35e 100644 --- a/src/cc/co/evenprime/bukkit/nocheat/checks/moving/MovingConfig.java +++ b/src/cc/co/evenprime/bukkit/nocheat/checks/moving/MovingConfig.java @@ -29,6 +29,7 @@ public class MovingConfig implements ConfigItem { public final ActionList flyingActions; public final boolean nofallCheck; + public final boolean nofallaggressive; public final float nofallMultiplier; public final ActionList nofallActions; @@ -59,6 +60,7 @@ public class MovingConfig implements ConfigItem { nofallCheck = data.getBoolean(ConfPaths.MOVING_RUNFLY_CHECKNOFALL); nofallMultiplier = ((float) 200) / 100F; + nofallaggressive = data.getBoolean(ConfPaths.MOVING_RUNFLY_NOFALLAGGRESSIVE); nofallActions = data.getActionList(ConfPaths.MOVING_RUNFLY_NOFALLACTIONS); morePacketsCheck = data.getBoolean(ConfPaths.MOVING_MOREPACKETS_CHECK); diff --git a/src/cc/co/evenprime/bukkit/nocheat/checks/moving/NoFallCheck.java b/src/cc/co/evenprime/bukkit/nocheat/checks/moving/NoFallCheck.java index 43439d51..ea90a68c 100644 --- a/src/cc/co/evenprime/bukkit/nocheat/checks/moving/NoFallCheck.java +++ b/src/cc/co/evenprime/bukkit/nocheat/checks/moving/NoFallCheck.java @@ -31,15 +31,23 @@ public class NoFallCheck extends MovingCheck { data.lastAddedFallDistance = 0F; return null; } - + // This check is pretty much always a step behind for technical reasons. if(data.fromOnOrInGround) { // Start with zero fall distance data.fallDistance = 0F; } - - if(data.fromOnOrInGround && data.toOnOrInGround && data.from.y <= data.to.y && player.getPlayer().getFallDistance() > 2.0F) { - player.dealFallDamage(); + + if(cc.nofallaggressive && data.fromOnOrInGround && data.toOnOrInGround && data.from.y <= data.to.y && player.getPlayer().getFallDistance() > 3.0F) { + data.fallDistance = player.getPlayer().getFallDistance(); + data.nofallVL += data.fallDistance; + data.nofallTotalVL += data.fallDistance; + data.nofallFailed++; + final boolean cancel = executeActions(player, cc.nofallActions.getActions(data.nofallVL)); + if(cancel) { + player.dealFallDamage(); + } + data.fallDistance = 0F; } // If we increased fall height before for no good reason, reduce now by diff --git a/src/cc/co/evenprime/bukkit/nocheat/config/ConfPaths.java b/src/cc/co/evenprime/bukkit/nocheat/config/ConfPaths.java index 1103c7f8..349a5ceb 100644 --- a/src/cc/co/evenprime/bukkit/nocheat/config/ConfPaths.java +++ b/src/cc/co/evenprime/bukkit/nocheat/config/ConfPaths.java @@ -31,6 +31,7 @@ public abstract class ConfPaths { public final static String MOVING_RUNFLY_ACTIONS = MOVING_RUNFLY + "actions"; public final static String MOVING_RUNFLY_CHECKNOFALL = MOVING_RUNFLY + "checknofall"; + public final static String MOVING_RUNFLY_NOFALLAGGRESSIVE = MOVING_RUNFLY + "nofallaggressivemode"; public final static String MOVING_RUNFLY_NOFALLACTIONS = MOVING_RUNFLY + "nofallactions"; private final static String MOVING_RUNFLY_FLYING = MOVING_RUNFLY + "flying."; diff --git a/src/cc/co/evenprime/bukkit/nocheat/config/DefaultConfiguration.java b/src/cc/co/evenprime/bukkit/nocheat/config/DefaultConfiguration.java index 578599fc..8d599181 100644 --- a/src/cc/co/evenprime/bukkit/nocheat/config/DefaultConfiguration.java +++ b/src/cc/co/evenprime/bukkit/nocheat/config/DefaultConfiguration.java @@ -36,6 +36,7 @@ public class DefaultConfiguration extends NoCheatConfiguration { set(ConfPaths.MOVING_RUNFLY_ACTIONS, "log:moveshort:3:5:f cancel vl>100 log:moveshort:0:5:if cancel vl>400 log:movelong:0:5:cif cancel"); set(ConfPaths.MOVING_RUNFLY_CHECKNOFALL, true); + set(ConfPaths.MOVING_RUNFLY_NOFALLAGGRESSIVE, true); set(ConfPaths.MOVING_RUNFLY_NOFALLACTIONS, "log:nofall:0:5:cif cancel"); set(ConfPaths.MOVING_RUNFLY_FLYING_ALLOWALWAYS, false);