diff --git a/pom.xml b/pom.xml index cc2ed7a6..78ab1195 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 cc.co.evenprime.bukkit NoCheat - 2.17a + 2.17b jar NoCheat diff --git a/src/cc/co/evenprime/bukkit/nocheat/NoCheatPlayer.java b/src/cc/co/evenprime/bukkit/nocheat/NoCheatPlayer.java index 5c75e072..fb3a9136 100644 --- a/src/cc/co/evenprime/bukkit/nocheat/NoCheatPlayer.java +++ b/src/cc/co/evenprime/bukkit/nocheat/NoCheatPlayer.java @@ -15,6 +15,8 @@ public interface NoCheatPlayer { public BaseData getData(); + public boolean isDead(); + public boolean isSprinting(); public int getTicksLived(); diff --git a/src/cc/co/evenprime/bukkit/nocheat/checks/timed/GodmodeCheck.java b/src/cc/co/evenprime/bukkit/nocheat/checks/timed/GodmodeCheck.java index a0bef5d2..ab5004dc 100644 --- a/src/cc/co/evenprime/bukkit/nocheat/checks/timed/GodmodeCheck.java +++ b/src/cc/co/evenprime/bukkit/nocheat/checks/timed/GodmodeCheck.java @@ -20,8 +20,10 @@ public class GodmodeCheck extends TimedCheck { public void check(NoCheatPlayer player, TimedData data, CCTimed cc) { // server lag(ged), skip this, or player dead, therefore it's reasonable // for him to not move :) - if(plugin.skipCheck() || player.getPlayer().isDead()) + if(plugin.skipCheck() || player.isDead()) { + data.ticksBehind = 0; return; + } final int ticksLived = player.getTicksLived(); diff --git a/src/cc/co/evenprime/bukkit/nocheat/events/MovingEventManager.java b/src/cc/co/evenprime/bukkit/nocheat/events/MovingEventManager.java index 1f263576..5c07c35a 100644 --- a/src/cc/co/evenprime/bukkit/nocheat/events/MovingEventManager.java +++ b/src/cc/co/evenprime/bukkit/nocheat/events/MovingEventManager.java @@ -104,13 +104,14 @@ public class MovingEventManager extends EventManagerImpl { @Override protected void handlePlayerMoveEvent(final PlayerMoveEvent event, final Priority priority) { - // Not interested at all in players in vehicles - if(event.getPlayer().isInsideVehicle()) { + // Get the world-specific configuration that applies here + final NoCheatPlayer player = plugin.getPlayer(event.getPlayer()); + + // Not interested at all in players in vehicles or dead + if(event.getPlayer().isInsideVehicle() || player.isDead()) { return; } - // Get the world-specific configuration that applies here - final NoCheatPlayer player = plugin.getPlayer(event.getPlayer()); final CCMoving cc = player.getConfiguration().moving; if(!cc.check || player.hasPermission(Permissions.MOVING)) { diff --git a/src/cc/co/evenprime/bukkit/nocheat/player/NoCheatPlayerImpl.java b/src/cc/co/evenprime/bukkit/nocheat/player/NoCheatPlayerImpl.java index 6dfba091..41009803 100644 --- a/src/cc/co/evenprime/bukkit/nocheat/player/NoCheatPlayerImpl.java +++ b/src/cc/co/evenprime/bukkit/nocheat/player/NoCheatPlayerImpl.java @@ -37,6 +37,9 @@ public class NoCheatPlayerImpl implements NoCheatPlayer { this.player = player; } + public boolean isDead() { + return this.player.getHealth() <= 0 || this.player.isDead(); + } public boolean hasPermission(String permission) { if(permission == null) { System.out.println("NoCheat: Warning, asked for null permission");