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 author: Evenprime
main: cc.co.evenprime.bukkit.nocheat.NoCheat main: cc.co.evenprime.bukkit.nocheat.NoCheat
version: 0.9.5 version: 0.9.6
commands: commands:
nocheat: nocheat:

View File

@ -322,10 +322,11 @@ public class MovingCheck extends Check {
final double z = from.getZ(); final double z = from.getZ();
final Location l = data.lastLocation; 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; return true;
}
// Something or someone moved the player without causing a move event - Can't do much with that // 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); resetData(data, to);
return true; return true;
} }

View File

@ -39,8 +39,11 @@ public class MovingPlayerMonitor extends PlayerListener {
@Override @Override
public void onPlayerMove(PlayerMoveEvent event) { public void onPlayerMove(PlayerMoveEvent event) {
MovingData data = MovingData.get(event.getPlayer()); if(!event.getPlayer().isInsideVehicle()) {
data.lastLocation = event.getTo(); MovingData data = MovingData.get(event.getPlayer());
check.updateVelocity(event.getPlayer().getVelocity(), data); data.lastLocation = event.getTo();
check.updateVelocity(event.getPlayer().getVelocity(), data);
}
} }
} }