mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2025-03-12 14:39:12 +01:00
Keep track of ModelFlying in MoveData.
This commit is contained in:
parent
ca8cbdaf05
commit
8d43b0abc5
@ -49,8 +49,11 @@ public class CreativeFly extends Check {
|
||||
// Reset tags, just in case.
|
||||
tags.clear();
|
||||
|
||||
// Edge data for this move.
|
||||
// Some edge data for this move.
|
||||
final GameMode gameMode = player.getGameMode();
|
||||
final ModelFlying model = cc.getModelFlying(player, from);
|
||||
final MoveData thisMove = data.thisMove;
|
||||
thisMove.modelFlying = model;
|
||||
final MoveData lastMove = data.moveData.getFirst();
|
||||
|
||||
// Ensure we have a set-back location.
|
||||
@ -58,10 +61,6 @@ public class CreativeFly extends Check {
|
||||
data.setSetBack(from);
|
||||
}
|
||||
|
||||
final GameMode gameMode = player.getGameMode();
|
||||
final ModelFlying model = cc.getModelFlying(player, from);
|
||||
// TODO: Store model in past moves?
|
||||
|
||||
// Before doing anything, do a basic height check to determine if players are flying too high.
|
||||
final double maximumHeight = model.maxHeight + player.getWorld().getMaxHeight();
|
||||
if (to.getY() > maximumHeight) {
|
||||
|
@ -130,6 +130,12 @@ public class MoveData {
|
||||
*/
|
||||
public CheckType flyCheck;
|
||||
|
||||
/**
|
||||
* The ModelFlying instance used with this move, will be null if it doesn't
|
||||
* apply.
|
||||
*/
|
||||
public ModelFlying modelFlying;
|
||||
|
||||
public boolean mightBeMultipleMoves;
|
||||
|
||||
private void setPositions(final PlayerLocation from, final PlayerLocation to) {
|
||||
@ -170,6 +176,7 @@ public class MoveData {
|
||||
hAllowedDistance = 0.0;
|
||||
// Meta stuff.
|
||||
flyCheck = CheckType.UNKNOWN;
|
||||
modelFlying = null;
|
||||
mightBeMultipleMoves = false;
|
||||
// Done.
|
||||
valid = true;
|
||||
|
Loading…
Reference in New Issue
Block a user