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 author: Evenprime
main: cc.co.evenprime.bukkit.nocheat.NoCheat main: cc.co.evenprime.bukkit.nocheat.NoCheat
version: 1.09d version: 1.09e
softdepend: [ Permissions, CraftIRC ] softdepend: [ Permissions, CraftIRC ]

View File

@ -89,6 +89,7 @@ public class FlyingCheck {
// The server sent the player a "velocity" packet a short time ago // The server sent the player a "velocity" packet a short time ago
if(data.maxYVelocity > 0.0D) { if(data.maxYVelocity > 0.0D) {
data.vertFreedomCounter = 30; data.vertFreedomCounter = 30;
// Be generous with the height limit for the client // Be generous with the height limit for the client
@ -100,7 +101,7 @@ public class FlyingCheck {
if(data.vertFreedomCounter > 0) { if(data.vertFreedomCounter > 0) {
data.vertFreedomCounter--; data.vertFreedomCounter--;
} }
final double limit = data.vertFreedom; final double limit = data.vertFreedom;
// If the event counter has been consumed, remove the vertical movement limit increase when landing the next time // 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, result += Math.max(0D, runningCheck.check(from, to,
!allowFakeSneak && player.isSneaking(), !allowFastSwim && (fromType & toType & MovingEventHelper.LIQUID) > 0, data)); !allowFakeSneak && player.isSneaking(), !allowFastSwim && (fromType & toType & MovingEventHelper.LIQUID) > 0, data));
} }
/********* HANDLE/COMBINE THE RESULTS OF THE CHECKS ***********/ /********* HANDLE/COMBINE THE RESULTS OF THE CHECKS ***********/
data.jumpPhase++; data.jumpPhase++;

View File

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

View File

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