Class PathingOptions
java.lang.Object
com.minecolonies.core.entity.pathfinding.PathingOptions
Configuration values for pathing, used by pathjobs and normally set through the navigator
-
Field Summary
FieldsModifier and TypeFieldDescriptiondoubleCost added for going against the blocks inherent direction/facing valuebooleanWhether we can drop down more than one blockdoubleAdditional cost of cave air.doubleCost to dive (head underwater).doubleAdditional cost of droppingdoubleAdditional cost of jumpingstatic final intMaximum cost useddoubleCost to climb a non ladder.doubleCost improvement of paths - base 1.doubleCost improvement of paths - base 1.doubleThe rails exit cost.doubleFactor multiplied to the small random base cost of values, increases this increases the paths randomness/volatilty.doubleAdditional cost of swimming - base 1.doubleAdditional cost enter entering waterdoubleCost to traverse trap doorsprotected floatAny turn penalty to be applied for cornering, u-turns, etc.doubleCost for walking within shapes(e.g. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanWhether the entity can enter doors, including gates.booleanWhether the entity can enter gates (not counting doors)booleanbooleanbooleancanSwim()booleanbooleanfloatReturns the turn penalty for the entity.voidimportFrom(PathingOptions pathingOptions) Imports all options from the given other pathing optionsvoidsetCanClimbAdvanced(boolean canClimbAdvanced) voidsetCanOpenDoors(boolean canOpenDoors) voidsetCanSwim(boolean canSwim) voidsetCanUseRails(boolean canUseRails) voidsetEnterDoors(boolean enterDoors) voidsetEnterGates(boolean enterGates) voidsetPassDanger(boolean danger) voidsetTurnPenalty(float turnPenalty) Sets the turn penalty for the entity.voidsetWalkUnderWater(boolean walkUnderWater) withBadDirectionCost(double badDirectionCost) withCanEnterDoors(boolean canEnter) Set door opening capabilitywithCanEnterGates(boolean canEnter) withCanSwim(boolean canswim) Sets swimming abilitywithDivingCost(double divingCost) withDropCost(double dropCost) withJumpCost(double jumpCost) withNonLadderClimbableCost(double nonLadderClimbableCost) withOnPathCost(double onPathCost) withOnRailCost(double onRailCost) withRailExitCost(double railExitCost) withStartSwimCost(double startSwimCost) withSwimCost(double swimCost) withToggleCost(double toggleCost) withTurnPenalty(float turnPenalty) Set the penalty for making a turn while pathfinding.withWalkUnderWater(boolean walkUnderWater) Set under water walking opening capability
-
Field Details
-
MAX_COST
public static final int MAX_COSTMaximum cost used- See Also:
-
jumpCost
public double jumpCostAdditional cost of jumping -
dropCost
public double dropCostAdditional cost of dropping -
onPathCost
public double onPathCostCost improvement of paths - base 1. -
onRailCost
public double onRailCostCost improvement of paths - base 1. -
railsExitCost
public double railsExitCostThe rails exit cost. -
swimCost
public double swimCostAdditional cost of swimming - base 1. -
caveAirCost
public double caveAirCostAdditional cost of cave air. -
swimCostEnter
public double swimCostEnterAdditional cost enter entering water -
traverseToggleAbleCost
public double traverseToggleAbleCostCost to traverse trap doors -
nonLadderClimbableCost
public double nonLadderClimbableCostCost to climb a non ladder. -
walkInShapesCost
public double walkInShapesCostCost for walking within shapes(e.g. panels) -
divingCost
public double divingCostCost to dive (head underwater). -
badDirectionCost
public double badDirectionCostCost added for going against the blocks inherent direction/facing value -
randomnessFactor
public double randomnessFactorFactor 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 canDropWhether we can drop down more than one block -
turnPenalty
protected float turnPenaltyAny 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
-
withSwimCost
-
withJumpCost
-
withDropCost
-
withOnPathCost
-
withOnRailCost
-
withRailExitCost
-
withToggleCost
-
withNonLadderClimbableCost
-
withDivingCost
-
withBadDirectionCost
-
withCanSwim
Sets swimming ability- Parameters:
canswim- whether swimming is allowed- Returns:
-
withCanEnterDoors
Set door opening capability- Parameters:
canEnter- whether we can enter doors- Returns:
-
withCanEnterGates
- Parameters:
canEnter- whether we can enter gates- Returns:
-
withWalkUnderWater
Set under water walking opening capability- Parameters:
walkUnderWater- whether we can walk underwater- Returns:
-
withTurnPenalty
Set the penalty for making a turn while pathfinding.- Parameters:
turnPenalty- the penalty for making a turn- Returns:
- this PathingOptions object
-
importFrom
Imports all options from the given other pathing options- Parameters:
pathingOptions-
-