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:
Evenprime 2011-05-01 23:42:26 +02:00
parent 11e18e0423
commit b656644b29
3 changed files with 10 additions and 6 deletions

View File

@ -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:

View File

@ -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;
}

View File

@ -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);
}
}
}