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
|
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:
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
@ -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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user