Class PathingOptions

java.lang.Object
com.minecolonies.core.entity.pathfinding.PathingOptions

public class PathingOptions extends Object
Configuration values for pathing, used by pathjobs and normally set through the navigator
  • Field Details

    • MAX_COST

      public static final int MAX_COST
      Maximum cost used
      See Also:
    • jumpCost

      public double jumpCost
      Additional cost of jumping
    • dropCost

      public double dropCost
      Additional cost of dropping
    • onPathCost

      public double onPathCost
      Cost improvement of paths - base 1.
    • onRailCost

      public double onRailCost
      Cost improvement of paths - base 1.
    • railsExitCost

      public double railsExitCost
      The rails exit cost.
    • swimCost

      public double swimCost
      Additional cost of swimming - base 1.
    • caveAirCost

      public double caveAirCost
      Additional cost of cave air.
    • swimCostEnter

      public double swimCostEnter
      Additional cost enter entering water
    • traverseToggleAbleCost

      public double traverseToggleAbleCost
      Cost to traverse trap doors
    • nonLadderClimbableCost

      public double nonLadderClimbableCost
      Cost to climb a non ladder.
    • walkInShapesCost

      public double walkInShapesCost
      Cost for walking within shapes(e.g. panels)
    • divingCost

      public double divingCost
      Cost to dive (head underwater).
    • badDirectionCost

      public double badDirectionCost
      Cost added for going against the blocks inherent direction/facing value
    • randomnessFactor

      public double randomnessFactor
      Factor multiplied to the small random base cost of values, increases this increases the paths randomness/volatilty. Set to 0 to disable rng.
    • canDrop

      public boolean canDrop
      Whether we can drop down more than one block
    • turnPenalty

      protected float turnPenalty
      Any turn penalty to be applied for cornering, u-turns, etc.
  • Constructor Details

    • PathingOptions

      public PathingOptions()
  • Method Details

    • canOpenDoors

      public boolean canOpenDoors()
    • setCanOpenDoors

      public void setCanOpenDoors(boolean canOpenDoors)
    • canUseRails

      public boolean canUseRails()
    • canClimbAdvanced

      public boolean canClimbAdvanced()
    • setCanUseRails

      public void setCanUseRails(boolean canUseRails)
    • setCanClimbAdvanced

      public void setCanClimbAdvanced(boolean canClimbAdvanced)
    • canSwim

      public boolean canSwim()
    • setCanSwim

      public void setCanSwim(boolean canSwim)
    • canEnterDoors

      public boolean canEnterDoors()
      Whether the entity can enter doors, including gates.
      Returns:
      true if the entity can enter doors, false otherwise
    • canEnterGates

      public boolean canEnterGates()
      Whether the entity can enter gates (not counting doors)
      Returns:
      true if the entity can enter gates, false otherwise
    • getTurnPenalty

      public float getTurnPenalty()
      Returns the turn penalty for the entity. This is a float value that represents the extra cost for the entity to make a turn while pathfinding. A higher value increases the cost, while a lower value decreases it. A value of 0 disables the turn penalty.
      Returns:
      the turn penalty for the entity
    • setEnterDoors

      public void setEnterDoors(boolean enterDoors)
    • setEnterGates

      public void setEnterGates(boolean enterGates)
    • setPassDanger

      public void setPassDanger(boolean danger)
    • canPassDanger

      public boolean canPassDanger()
    • canWalkUnderWater

      public boolean canWalkUnderWater()
    • setWalkUnderWater

      public void setWalkUnderWater(boolean walkUnderWater)
    • setTurnPenalty

      public void setTurnPenalty(float turnPenalty)
      Sets the turn penalty for the entity.
      Parameters:
      turnPenalty - the turn penalty for the entity
    • withStartSwimCost

      public PathingOptions withStartSwimCost(double startSwimCost)
    • withSwimCost

      public PathingOptions withSwimCost(double swimCost)
    • withJumpCost

      public PathingOptions withJumpCost(double jumpCost)
    • withDropCost

      public PathingOptions withDropCost(double dropCost)
    • withOnPathCost

      public PathingOptions withOnPathCost(double onPathCost)
    • withOnRailCost

      public PathingOptions withOnRailCost(double onRailCost)
    • withRailExitCost

      public PathingOptions withRailExitCost(double railExitCost)
    • withToggleCost

      public PathingOptions withToggleCost(double toggleCost)
    • withNonLadderClimbableCost

      public PathingOptions withNonLadderClimbableCost(double nonLadderClimbableCost)
    • withDivingCost

      public PathingOptions withDivingCost(double divingCost)
    • withBadDirectionCost

      public PathingOptions withBadDirectionCost(double badDirectionCost)
    • withCanSwim

      public PathingOptions withCanSwim(boolean canswim)
      Sets swimming ability
      Parameters:
      canswim - whether swimming is allowed
      Returns:
    • withCanEnterDoors

      public PathingOptions withCanEnterDoors(boolean canEnter)
      Set door opening capability
      Parameters:
      canEnter - whether we can enter doors
      Returns:
    • withCanEnterGates

      public PathingOptions withCanEnterGates(boolean canEnter)
      Parameters:
      canEnter - whether we can enter gates
      Returns:
    • withWalkUnderWater

      public PathingOptions withWalkUnderWater(boolean walkUnderWater)
      Set under water walking opening capability
      Parameters:
      walkUnderWater - whether we can walk underwater
      Returns:
    • withTurnPenalty

      public PathingOptions withTurnPenalty(float turnPenalty)
      Set the penalty for making a turn while pathfinding.
      Parameters:
      turnPenalty - the penalty for making a turn
      Returns:
      this PathingOptions object
    • importFrom

      public void importFrom(PathingOptions pathingOptions)
      Imports all options from the given other pathing options
      Parameters:
      pathingOptions -