mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-11-07 11:10:05 +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
|
author: Evenprime
|
||||||
|
|
||||||
main: cc.co.evenprime.bukkit.nocheat.NoCheatPlugin
|
main: cc.co.evenprime.bukkit.nocheat.NoCheatPlugin
|
||||||
version: 0.6.6
|
version: 0.6.6a
|
||||||
|
|
||||||
commands:
|
commands:
|
||||||
nocheat:
|
nocheat:
|
||||||
|
@ -274,6 +274,11 @@ public class MovingCheck {
|
|||||||
|
|
||||||
data.movingLegitMovesInARow = 0;
|
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;
|
String actions = null;
|
||||||
boolean log = true;
|
boolean log = true;
|
||||||
|
|
||||||
@ -381,9 +386,10 @@ public class MovingCheck {
|
|||||||
|
|
||||||
NoCheatData data = NoCheatPlugin.getPlayerData(event.getPlayer());
|
NoCheatData data = NoCheatPlugin.getPlayerData(event.getPlayer());
|
||||||
|
|
||||||
// Still not a perfect solution. After resetting a player his vertical momentum gets lost
|
// Reset the jumpphase. We choose the setback-point such that it should be
|
||||||
// Therefore we can't expect him to fall big distances in his next move, therefore we have to
|
// on solid ground, but in case it isn't (maybe the ground is gone now) we
|
||||||
// set his flying phase to something he can work with.
|
// 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;
|
data.movingJumpPhase = 0;
|
||||||
|
|
||||||
// If we have stored a location for the player, we put him back there
|
// If we have stored a location for the player, we put him back there
|
||||||
|
@ -50,6 +50,10 @@ public class SpeedhackCheck {
|
|||||||
data.speedhackViolationsInARow = 0;
|
data.speedhackViolationsInARow = 0;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
// If we haven't already got a setback point, create one now
|
||||||
|
if(data.speedhackSetBackPoint == null) {
|
||||||
|
data.speedhackSetBackPoint = event.getFrom().clone();
|
||||||
|
}
|
||||||
data.speedhackViolationsInARow++;
|
data.speedhackViolationsInARow++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user