Class WalkBreathingRules

java.lang.Object
com.hypixel.hytale.server.npc.util.WalkBreathingRules

public final class WalkBreathingRules extends Object
Stateless helper that decides which breathing samples a walk position needs.

A walk position takes up to two samples. One sits at breathing height, the other near the feet. RelaxedConstraint.BREATHE relaxes the breathing question itself, so it skips both. RelaxedConstraint.WADE relaxes only the sample near the feet, so an NPC may stand in water while it still has to breathe at breathing height.

  • Method Details

    • skipsBreathingTests

      public static boolean skipsBreathingTests(@Nonnull EnumSet<RelaxedConstraint> constraints)
      True when the position needs no breathing sample at all.
    • needsFeetSample

      public static boolean needsFeetSample(@Nonnull EnumSet<RelaxedConstraint> constraints, double breathingDepth, double constraintDepth)
      True when the sample near the feet still applies. Equal depths make it a repeat of the breathing height sample.