From 5485f1e09081d5c9410b69ac55cc354daf6fe395 Mon Sep 17 00:00:00 2001 From: Evenprime Date: Mon, 8 Aug 2011 18:25:19 +0200 Subject: [PATCH] Fix bug related to beds and make flying/jumping check a bit more precise. --- plugin.yml | 7 ++++++- src/cc/co/evenprime/bukkit/nocheat/checks/FlyingCheck.java | 4 ++-- src/cc/co/evenprime/bukkit/nocheat/checks/MovingCheck.java | 5 ----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/plugin.yml b/plugin.yml index 54e65365..30b6fcab 100644 --- a/plugin.yml +++ b/plugin.yml @@ -3,7 +3,7 @@ name: NoCheat author: Evenprime main: cc.co.evenprime.bukkit.nocheat.NoCheat -version: 1.11b +version: 1.11c softdepend: [ Permissions, CraftIRC ] @@ -17,6 +17,11 @@ commands: Example: / -p [player] | Get permissions of the player, * = check disabled globally permissions: + nocheat.*: + description: Allow the player to do everything (and get log messages) + children: + nocheat.all: true + nocheat.notify: true nocheat.all: description: Allow the player to do everything (except for getting log messages) children: diff --git a/src/cc/co/evenprime/bukkit/nocheat/checks/FlyingCheck.java b/src/cc/co/evenprime/bukkit/nocheat/checks/FlyingCheck.java index 8b9b10f0..03fe7350 100644 --- a/src/cc/co/evenprime/bukkit/nocheat/checks/FlyingCheck.java +++ b/src/cc/co/evenprime/bukkit/nocheat/checks/FlyingCheck.java @@ -47,7 +47,7 @@ public class FlyingCheck { // Walk or start Jump if(fromOnGround) { - distanceAboveLimit = toY - fromY - limit; + distanceAboveLimit = toY - Math.floor(fromY) - limit; } // Land or Fly/Fall else @@ -65,7 +65,7 @@ public class FlyingCheck { if(toOnGround) limit += stepHeight; - distanceAboveLimit = toY - l.getY() - limit; + distanceAboveLimit = toY - Math.floor(l.getY()) - limit; // Always give some bonus points in case of identical Y values in midair (hovering player) if(fromY == toY && !toOnGround) { diff --git a/src/cc/co/evenprime/bukkit/nocheat/checks/MovingCheck.java b/src/cc/co/evenprime/bukkit/nocheat/checks/MovingCheck.java index 38652f0f..afa15fca 100644 --- a/src/cc/co/evenprime/bukkit/nocheat/checks/MovingCheck.java +++ b/src/cc/co/evenprime/bukkit/nocheat/checks/MovingCheck.java @@ -204,11 +204,6 @@ public class MovingCheck extends Check { } } - // If the target is a bed, don't check (going to bed is a kind of mini teleport...) - if(to.getWorld().getBlockTypeIdAt(to) == Material.BED_BLOCK.getId()) { - return false; - } - return true; }