Package fr.neatmonster.nocheatplus.checks.moving

Examples of fr.neatmonster.nocheatplus.checks.moving.MovingConfig


     */
    public boolean check(final Player player, final Location loc, final FightData data, final FightConfig cc) {
        boolean cancel = false;
   
    final float mcFallDistance = player.getFallDistance();
    final MovingConfig mCc = MovingConfig.getConfig(player);
    if (mcFallDistance > 0.0 && cc.debug && player.hasPermission(Permissions.ADMINISTRATION_DEBUG)){
      final MovingData mData = MovingData.getData(player);
     
      if (MovingListener.shouldCheckSurvivalFly(player, mData, mCc) && CheckType.MOVING_NOFALL.isEnabled(player)){
        // TODO: Set max y in MovingListener, to be independent of sf/nofall!
        player.sendMessage("Critical: fd=" + mcFallDistance + "(" + mData.noFallFallDistance +") y=" + loc.getY() + ((mData.hasSetBack() && mData.getSetBackY() < mData.noFallMaxY) ? (" jumped=" + StringUtil.fdec3.format(mData.noFallMaxY - mData.getSetBackY())): ""));
      }
    }

        // Check if the hit was a critical hit (positive fall distance, entity in the air, not on ladder, not in liquid
        // and without blindness effect).
   
    // TODO: Skip the on-ground check somehow?
    // TODO: Implement low jump penalty.
        if (mcFallDistance > 0f && !player.hasPotionEffect(PotionEffectType.BLINDNESS)){
          // Might be a violation.
          final MovingData dataM = MovingData.getData(player);
          if (dataM.sfLowJump || player.getFallDistance() < cc.criticalFallDistance && !BlockProperties.isOnGroundOrResetCond(player, loc, mCc.yOnGround)){
            final MovingConfig ccM = MovingConfig.getConfig(player);
              if (MovingListener.shouldCheckSurvivalFly(player, dataM, ccM)){
                    final double deltaFallDistance = (cc.criticalFallDistance - player.getFallDistance()) / cc.criticalFallDistance;
                    // TODO: Cleanup: velocity is more like the gravity constant.
                    final double deltaVelocity = (cc.criticalVelocity - Math.abs(player.getVelocity().getY())) / cc.criticalVelocity;
                    double delta = deltaFallDistance > 0D ? deltaFallDistance : 0D + deltaVelocity > 0D ? deltaVelocity : 0D;
View Full Code Here


      // Check if fly checks is an issue at all, re-check "real sprinting".
        if (mData.fromX != Double.MAX_VALUE && mData.mediumLiftOff != MediumLiftOff.LIMIT_JUMP){
          final double hDist = TrigUtil.distance(loc.getX(), loc.getZ(), mData.fromX, mData.fromZ);
          if (hDist >= 0.23) {
            // TODO: Might need to check hDist relative to speed / modifiers.
            final MovingConfig mc = MovingConfig.getConfig(player);
            if (now <= mData.timeSprinting + mc.sprintingGrace && MovingListener.shouldCheckSurvivalFly(player, mData, mc)){
              // Judge as "lost sprint" problem.
              // TODO: What would mData.lostSprintCount > 0  mean here?
                mData.lostSprintCount = 7;
                if ((cc.debug || mc.debug) && BuildParameters.debugLevel > 0){
View Full Code Here

TOP

Related Classes of fr.neatmonster.nocheatplus.checks.moving.MovingConfig

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.