Package fr.neatmonster.nocheatplus.checks

Examples of fr.neatmonster.nocheatplus.checks.ViolationData


                // Increment violation level.
                data.creativeFlyVL += result;

                // Execute whatever actions are associated with this check and the violation level and find out if we
                // should cancel the event.
                final ViolationData vd = new ViolationData(this, player, data.creativeFlyVL, result, cc.creativeFlyActions);
                if (vd.needsParameters()) {
                    vd.setParameter(ParameterName.LOCATION_FROM, String.format(Locale.US, "%.2f, %.2f, %.2f", from.getX(), from.getY(), from.getZ()));
                    vd.setParameter(ParameterName.LOCATION_TO, String.format(Locale.US, "%.2f, %.2f, %.2f", to.getX(), to.getY(), to.getZ()));
                    vd.setParameter(ParameterName.DISTANCE, String.format(Locale.US, "%.2f", TrigUtil.distance(from,  to)));
                }
                if (executeActions(vd)) {
                    // Compose a new location based on coordinates of "newTo" and viewing direction of "event.getTo()"
                    // to allow the player to look somewhere else despite getting pulled back by NoCheatPlus.
                    return data.getSetBack(to);
View Full Code Here


         
            // Increment violation level.
            data.morePacketsVL = violation; // TODO: Accumulate somehow [e.g. always += 1, decrease with continuous moving without violation]?
           
            // Violation handling.
            final ViolationData vd = new ViolationData(this, player, data.morePacketsVL, violation, cc.morePacketsActions);
            if (cc.debug || vd.needsParameters()) {
              vd.setParameter(ParameterName.PACKETS, Integer.toString(new Double(violation).intValue()));
              vd.setParameter(ParameterName.TAGS, StringUtil.join(tags, "+"));
            }
            if (executeActions(vd)) {
              // Set to cancel the move.
              return data.getMorePacketsSetBack();
            }
View Full Code Here

   * @return
   */
  private boolean handleViolation(final Player player, final long violationTime, final BlockPlaceData data) {
    final double addedVL = 10.0 * Math.min(maxEditTime, violationTime) / maxEditTime;
    data.autoSignVL += addedVL;
    final ViolationData vd = new ViolationData(this, player, data.autoSignVL, addedVL, BlockPlaceConfig.getConfig(player).autoSignActions);
    if (vd.needsParameters()){
      vd.setParameter(ParameterName.TAGS, StringUtil.join(tags, "+"));
    }
    return executeActions(vd);
  }
View Full Code Here

      // TODO: Might have to do a specialized check for lag spikes here instead.
      final float lag = TickTask.getLag(expectedDuration, true);
      if (timeSpent * lag < expectedDuration){
        final double difference = (expectedDuration - timeSpent * lag) / 100.0;
        data.instantEatVL += difference;
        final ViolationData vd = new ViolationData(this, player, data.instantEatVL, difference, cc.fastConsumeActions);
        vd.setParameter(ParameterName.FOOD, "" + mat);
        if (data.instantEatFood != mat){
          vd.setParameter(ParameterName.TAGS, "inconsistent(" + data.instantEatFood + ")");
        }
        else{
          vd.setParameter(ParameterName.TAGS, "");
        }
        if (executeActions(vd)){
          return true;
        }
      }
View Full Code Here

TOP

Related Classes of fr.neatmonster.nocheatplus.checks.ViolationData

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.