mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2025-03-13 06:59:30 +01:00
Use moveInfo.useLoc for player move.
This commit is contained in:
parent
d05e683ee6
commit
18ddb34ace
@ -399,9 +399,9 @@ public class MovingListener extends CheckListener implements TickListener, IRemo
|
|||||||
// newTo should be null here.
|
// newTo should be null here.
|
||||||
|
|
||||||
// Fire one or two moves here.
|
// Fire one or two moves here.
|
||||||
final Location loc = player.getLocation(useLoc);
|
|
||||||
final MovingConfig cc = MovingConfig.getConfig(player);
|
final MovingConfig cc = MovingConfig.getConfig(player);
|
||||||
final MoveInfo moveInfo = useMoveInfo();
|
final MoveInfo moveInfo = useMoveInfo();
|
||||||
|
final Location loc = player.getLocation(moveInfo.useLoc);
|
||||||
if (TrigUtil.isSamePos(from, loc)
|
if (TrigUtil.isSamePos(from, loc)
|
||||||
|| TrigUtil.isSamePos(loc, data.fromX, data.fromY, data.fromZ)
|
|| TrigUtil.isSamePos(loc, data.fromX, data.fromY, data.fromZ)
|
||||||
// Could also be other envelopes (0.9 velocity upwards), too tedious to research.
|
// Could also be other envelopes (0.9 velocity upwards), too tedious to research.
|
||||||
@ -434,7 +434,6 @@ public class MovingListener extends CheckListener implements TickListener, IRemo
|
|||||||
// Cleanup.
|
// Cleanup.
|
||||||
data.joinOrRespawn = false;
|
data.joinOrRespawn = false;
|
||||||
returnMoveInfo(moveInfo);
|
returnMoveInfo(moveInfo);
|
||||||
useLoc.setWorld(null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -864,7 +863,7 @@ public class MovingListener extends CheckListener implements TickListener, IRemo
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Monitor level PlayerMoveEvent.
|
* Monitor level PlayerMoveEvent. Uses useLoc.
|
||||||
* @param event
|
* @param event
|
||||||
*/
|
*/
|
||||||
@EventHandler(priority=EventPriority.MONITOR, ignoreCancelled = false)
|
@EventHandler(priority=EventPriority.MONITOR, ignoreCancelled = false)
|
||||||
@ -893,7 +892,7 @@ public class MovingListener extends CheckListener implements TickListener, IRemo
|
|||||||
final MovingData mData = MovingData.getData(player);
|
final MovingData mData = MovingData.getData(player);
|
||||||
final long tick = TickTask.getTick();
|
final long tick = TickTask.getTick();
|
||||||
if (!event.isCancelled()) {
|
if (!event.isCancelled()) {
|
||||||
final Location pLoc = player.getLocation();
|
final Location pLoc = player.getLocation(useLoc);
|
||||||
onMoveMonitorNotCancelled(player, TrigUtil.isSamePosAndLook(pLoc, from) ? from : pLoc, event.getTo(), now, tick, data, mData);
|
onMoveMonitorNotCancelled(player, TrigUtil.isSamePosAndLook(pLoc, from) ? from : pLoc, event.getTo(), now, tick, data, mData);
|
||||||
useLoc.setWorld(null);
|
useLoc.setWorld(null);
|
||||||
}
|
}
|
||||||
@ -907,10 +906,10 @@ public class MovingListener extends CheckListener implements TickListener, IRemo
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Overrides useLoc if in vehicle.
|
* Uses useLoc if in vehicle.
|
||||||
* @param player
|
* @param player
|
||||||
* @param from
|
* @param from Might use useLoc, but will reset it, if in vehicle.
|
||||||
* @param to
|
* @param to Do not use useLoc for this.
|
||||||
* @param now
|
* @param now
|
||||||
* @param tick
|
* @param tick
|
||||||
* @param data
|
* @param data
|
||||||
|
Loading…
Reference in New Issue
Block a user