diff --git a/src/cc/co/evenprime/bukkit/nocheat/NoCheatPlayer.java b/src/cc/co/evenprime/bukkit/nocheat/NoCheatPlayer.java index a0f2e581..dcc0ab91 100644 --- a/src/cc/co/evenprime/bukkit/nocheat/NoCheatPlayer.java +++ b/src/cc/co/evenprime/bukkit/nocheat/NoCheatPlayer.java @@ -31,4 +31,6 @@ public interface NoCheatPlayer { public ExecutionHistory getExecutionHistory(); + public void dealFallDamage(); + } 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 6c365f05..43439d51 100644 --- a/src/cc/co/evenprime/bukkit/nocheat/checks/moving/NoFallCheck.java +++ b/src/cc/co/evenprime/bukkit/nocheat/checks/moving/NoFallCheck.java @@ -1,7 +1,6 @@ package cc.co.evenprime.bukkit.nocheat.checks.moving; import java.util.Locale; - import cc.co.evenprime.bukkit.nocheat.NoCheat; import cc.co.evenprime.bukkit.nocheat.NoCheatPlayer; import cc.co.evenprime.bukkit.nocheat.actions.ParameterName; @@ -32,12 +31,16 @@ 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 we increased fall height before for no good reason, reduce now by // the same amount diff --git a/src/cc/co/evenprime/bukkit/nocheat/player/NoCheatPlayerImpl.java b/src/cc/co/evenprime/bukkit/nocheat/player/NoCheatPlayerImpl.java index 717c7bc8..756140d1 100644 --- a/src/cc/co/evenprime/bukkit/nocheat/player/NoCheatPlayerImpl.java +++ b/src/cc/co/evenprime/bukkit/nocheat/player/NoCheatPlayerImpl.java @@ -117,4 +117,11 @@ public class NoCheatPlayerImpl implements NoCheatPlayer { public ExecutionHistory getExecutionHistory() { return history; } + + @Override + public void dealFallDamage() { + EntityPlayer p = ((CraftPlayer) player).getHandle(); + p.b(0D, true); + + } }