From e63d90e4cd4a7622e36aa0ba90689303cff4da04 Mon Sep 17 00:00:00 2001 From: Evenprime Date: Tue, 20 Sep 2011 18:41:15 +0200 Subject: [PATCH] Modified nofall check. Let the game decide if and when to do the damage, we just set the "fallDistance". --- plugin.yml | 2 +- src/cc/co/evenprime/bukkit/nocheat/NoCheat.java | 2 +- .../evenprime/bukkit/nocheat/checks/moving/NoFallCheck.java | 5 ++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/plugin.yml b/plugin.yml index 3e6788f8..04e34dc2 100644 --- a/plugin.yml +++ b/plugin.yml @@ -3,7 +3,7 @@ name: NoCheat author: Evenprime main: cc.co.evenprime.bukkit.nocheat.NoCheat -version: 2.06 +version: 2.06a permissions: diff --git a/src/cc/co/evenprime/bukkit/nocheat/NoCheat.java b/src/cc/co/evenprime/bukkit/nocheat/NoCheat.java index 9738d682..7876462b 100644 --- a/src/cc/co/evenprime/bukkit/nocheat/NoCheat.java +++ b/src/cc/co/evenprime/bukkit/nocheat/NoCheat.java @@ -72,7 +72,7 @@ public class NoCheat extends JavaPlugin { this.log = new LogManager(this); - log.logToConsole(LogLevel.MED, "[NoCheat] This version is EXPERIMENTAL and built specifically for CB #1138. It may break at any time and for any other version."); + log.logToConsole(LogLevel.MED, "[NoCheat] This version is EXPERIMENTAL and built specifically for CB #1150. It may break at any time and for any other version."); this.data = new DataManager(); 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 3495de0e..3f469109 100644 --- a/src/cc/co/evenprime/bukkit/nocheat/checks/moving/NoFallCheck.java +++ b/src/cc/co/evenprime/bukkit/nocheat/checks/moving/NoFallCheck.java @@ -41,7 +41,7 @@ public class NoFallCheck { * */ public void check(final Player player, final Location from, final boolean fromOnOrInGround, final Location to, final boolean toOnOrInGround, final ConfigurationCache cc, final MovingData data) { - + double oldY = from.getY(); double newY = to.getY(); @@ -50,7 +50,7 @@ public class NoFallCheck { // Start with zero fall distance data.fallDistance = 0F; } - + // We want to know if the fallDistance recorded by the game is smaller // than the fall distance recorded by the plugin float distance = data.fallDistance - player.getFallDistance(); @@ -69,7 +69,6 @@ public class NoFallCheck { // Increase the damage a bit :) float totalDistance = (data.fallDistance - 2.0F)* cc.moving.nofallMultiplier + 2.0F; player.setFallDistance(totalDistance); - ((CraftPlayer)player).getHandle().b(totalDistance, true); } data.fallDistance = 0F;