}
public PreciseLocation check(NoCheatPlayer player, MovingData data, MovingConfig cc) {
// Some shortcuts:
final PreciseLocation setBack = data.runflySetBackPoint;
final PreciseLocation to = data.to;
final PreciseLocation from = data.from;
// Calculate some distances
final double xDistance = data.to.x - from.x;
final double zDistance = to.z - from.z;
final double horizontalDistance = Math.sqrt((xDistance * xDistance + zDistance * zDistance));
if(!setBack.isSet()) {
setBack.set(from);
}
// To know if a player "is on ground" is useful
final int fromType = CheckUtil.evaluateLocation(player.getPlayer().getWorld(), from);
final int toType = CheckUtil.evaluateLocation(player.getPlayer().getWorld(), to);
final boolean fromOnGround = CheckUtil.isOnGround(fromType);
final boolean fromInGround = CheckUtil.isInGround(fromType);
final boolean toOnGround = CheckUtil.isOnGround(toType);
final boolean toInGround = CheckUtil.isInGround(toType);
PreciseLocation newToLocation = null;
final double resultHoriz = Math.max(0.0D, checkHorizontal(player, data, CheckUtil.isLiquid(fromType) && CheckUtil.isLiquid(toType), horizontalDistance, cc));
final double resultVert = Math.max(0.0D, checkVertical(player, data, fromOnGround, toOnGround, cc));
final double result = (resultHoriz + resultVert) * 100;