mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-11-07 03:02:11 +01:00
Fixed some minor loopholes that would allow players to
fly/speedhack after getting legitimately teleported somewhere. They would've still been logged, but the "reset" functionality could be broken in these cases.
This commit is contained in:
parent
36953f4f08
commit
e388d44719
@ -3,7 +3,7 @@ name: NoCheatPlugin
|
||||
author: Evenprime
|
||||
|
||||
main: cc.co.evenprime.bukkit.nocheat.NoCheatPlugin
|
||||
version: 0.6.6
|
||||
version: 0.6.6a
|
||||
|
||||
commands:
|
||||
nocheat:
|
||||
|
@ -274,6 +274,11 @@ public class MovingCheck {
|
||||
|
||||
data.movingLegitMovesInARow = 0;
|
||||
|
||||
// If we haven't already got a setback point, make this location the new setback point
|
||||
if(data.movingSetBackPoint == null) {
|
||||
data.movingSetBackPoint = event.getFrom().clone();
|
||||
}
|
||||
|
||||
String actions = null;
|
||||
boolean log = true;
|
||||
|
||||
@ -381,9 +386,10 @@ public class MovingCheck {
|
||||
|
||||
NoCheatData data = NoCheatPlugin.getPlayerData(event.getPlayer());
|
||||
|
||||
// Still not a perfect solution. After resetting a player his vertical momentum gets lost
|
||||
// Therefore we can't expect him to fall big distances in his next move, therefore we have to
|
||||
// set his flying phase to something he can work with.
|
||||
// Reset the jumpphase. We choose the setback-point such that it should be
|
||||
// on solid ground, but in case it isn't (maybe the ground is gone now) we
|
||||
// still have to allow the player some freedom with vertical movement due
|
||||
// to lost vertical momentum to prevent him from getting stuck
|
||||
data.movingJumpPhase = 0;
|
||||
|
||||
// If we have stored a location for the player, we put him back there
|
||||
|
@ -50,6 +50,10 @@ public class SpeedhackCheck {
|
||||
data.speedhackViolationsInARow = 0;
|
||||
}
|
||||
else {
|
||||
// If we haven't already got a setback point, create one now
|
||||
if(data.speedhackSetBackPoint == null) {
|
||||
data.speedhackSetBackPoint = event.getFrom().clone();
|
||||
}
|
||||
data.speedhackViolationsInARow++;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user