Fixed compatibility with Superjump plugin (and reduced false positives

in other cases)
This commit is contained in:
Evenprime 2011-07-16 15:10:48 +02:00
parent 68591702cb
commit c5ec73b1f4
5 changed files with 12 additions and 12 deletions

View File

@ -3,7 +3,7 @@ name: NoCheat
author: Evenprime
main: cc.co.evenprime.bukkit.nocheat.NoCheat
version: 1.09d
version: 1.09e
softdepend: [ Permissions, CraftIRC ]

View File

@ -89,6 +89,7 @@ public class FlyingCheck {
// The server sent the player a "velocity" packet a short time ago
if(data.maxYVelocity > 0.0D) {
data.vertFreedomCounter = 30;
// Be generous with the height limit for the client
@ -100,7 +101,7 @@ public class FlyingCheck {
if(data.vertFreedomCounter > 0) {
data.vertFreedomCounter--;
}
final double limit = data.vertFreedom;
// If the event counter has been consumed, remove the vertical movement limit increase when landing the next time

View File

@ -120,8 +120,7 @@ public class MovingCheck extends Check {
result += Math.max(0D, runningCheck.check(from, to,
!allowFakeSneak && player.isSneaking(), !allowFastSwim && (fromType & toType & MovingEventHelper.LIQUID) > 0, data));
}
/********* HANDLE/COMBINE THE RESULTS OF THE CHECKS ***********/
data.jumpPhase++;

View File

@ -34,6 +34,6 @@ public class RunningCheck {
distanceAboveLimit = totalDistance - stepWidth;
}
return distanceAboveLimit;
return distanceAboveLimit - data.horizFreedom;
}
}

View File

@ -22,7 +22,7 @@ public class MovingPlayerMonitor extends PlayerListener {
public MovingPlayerMonitor(MovingCheck check) {
this.check = check;
}
@Override
public void onPlayerRespawn(PlayerRespawnEvent event) {
MovingData data = MovingData.get(event.getPlayer());
@ -35,12 +35,12 @@ public class MovingPlayerMonitor extends PlayerListener {
public void onPlayerPortal(PlayerPortalEvent event) {
check.teleported(event);
}
@Override
public void onPlayerTeleport(PlayerTeleportEvent event) {
check.teleported(event);
}
@Override
public void onPlayerInteract(PlayerInteractEvent event) {
@ -49,17 +49,17 @@ public class MovingPlayerMonitor extends PlayerListener {
@Override
public void onPlayerMove(PlayerMoveEvent event) {
MovingData data = MovingData.get(event.getPlayer());
check.updateVelocity(event.getPlayer().getVelocity(), data);
if(!event.isCancelled()) {
MovingData data = MovingData.get(event.getPlayer());
if( event.getPlayer().isInsideVehicle()) {
data.setBackPoint = event.getTo();
}
else {
data.insideVehicle = false;
}
check.updateVelocity(event.getPlayer().getVelocity(), data);
}
}
}