mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-11-03 01:00:20 +01:00
Fix for a bug with Minecarts /and probably other vehicles) that only
happens if players destroy their cart instead of leaving it.
This commit is contained in:
parent
11e18e0423
commit
b656644b29
@ -3,7 +3,7 @@ name: NoCheat
|
||||
author: Evenprime
|
||||
|
||||
main: cc.co.evenprime.bukkit.nocheat.NoCheat
|
||||
version: 0.9.5
|
||||
version: 0.9.6
|
||||
|
||||
commands:
|
||||
nocheat:
|
||||
|
@ -322,10 +322,11 @@ public class MovingCheck extends Check {
|
||||
final double z = from.getZ();
|
||||
final Location l = data.lastLocation;
|
||||
|
||||
if(x == to.getX() && z == to.getZ() && y == to.getY() )
|
||||
if(x == to.getX() && z == to.getZ() && y == to.getY() ) {
|
||||
return true;
|
||||
}
|
||||
// Something or someone moved the player without causing a move event - Can't do much with that
|
||||
if(!(x == l.getX() && z == l.getZ() && y == l.getY())){
|
||||
else if(!(x == l.getX() && z == l.getZ() && y == l.getY())){
|
||||
resetData(data, to);
|
||||
return true;
|
||||
}
|
||||
|
@ -39,8 +39,11 @@ public class MovingPlayerMonitor extends PlayerListener {
|
||||
|
||||
@Override
|
||||
public void onPlayerMove(PlayerMoveEvent event) {
|
||||
MovingData data = MovingData.get(event.getPlayer());
|
||||
data.lastLocation = event.getTo();
|
||||
check.updateVelocity(event.getPlayer().getVelocity(), data);
|
||||
if(!event.getPlayer().isInsideVehicle()) {
|
||||
MovingData data = MovingData.get(event.getPlayer());
|
||||
data.lastLocation = event.getTo();
|
||||
|
||||
check.updateVelocity(event.getPlayer().getVelocity(), data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user