Class PathJobEscapeWater
java.lang.Object
com.minecolonies.core.entity.pathfinding.pathjobs.AbstractPathJob
com.minecolonies.core.entity.pathfinding.pathjobs.PathJobEscapeWater
- All Implemented Interfaces:
IPathJob,IDestinationPathJob,Callable<net.minecraft.world.level.pathfinder.Path>
Job that handles moving away from something.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final @NotNull net.minecraft.core.BlockPosPosition to run to, in order to avoid something.Fields inherited from class com.minecolonies.core.entity.pathfinding.pathjobs.AbstractPathJob
cachedBlockLookup, debugDrawEnabled, debugNodesExtra, debugNodesNotVisited, debugNodesOrgPath, debugNodesPath, debugNodesVisited, debugNodesVisitedLater, entity, extraNodes, heuristicMod, MAX_NODES, maxNodes, result, start, tempWorldPos, totalNodesVisited, world -
Constructor Summary
ConstructorsConstructorDescriptionPathJobEscapeWater(net.minecraft.world.level.Level world, @NotNull net.minecraft.core.BlockPos start, int range, net.minecraft.world.entity.Mob entity) Prepares the PathJob for the path finding system. -
Method Summary
Modifier and TypeMethodDescriptionprotected doublecomputeHeuristic(int x, int y, int z) For MoveAwayFromLocation we want our heuristic to weight.net.minecraft.core.BlockPosReturn the destinationprotected booleanisAtDestination(@NotNull MNode n) Checks if the destination has been reached.voidsetPathingOptions(PathingOptions pathingOptions) Sets the pathing optionsMethods inherited from class com.minecolonies.core.entity.pathfinding.pathjobs.AbstractPathJob
call, computeCost, exploreInDirection, getActualWorld, getEndNodeScore, getEntity, getGroundHeight, getPathingOptions, getResult, getStart, handleDebugOptions, initDebug, isPassable, isPassable, modifyCost, search, stopOnNodeLimit, syncDebug, toString, visitNode
-
Field Details
-
avoid
@NotNull protected final @NotNull net.minecraft.core.BlockPos avoidPosition to run to, in order to avoid something.
-
-
Constructor Details
-
PathJobEscapeWater
public PathJobEscapeWater(net.minecraft.world.level.Level world, @NotNull @NotNull net.minecraft.core.BlockPos start, int range, net.minecraft.world.entity.Mob entity) Prepares the PathJob for the path finding system.- Parameters:
world- world the entity is in.start- starting location.range- max range to search.entity- the entity.
-
-
Method Details
-
computeHeuristic
protected double computeHeuristic(int x, int y, int z) For MoveAwayFromLocation we want our heuristic to weight.- Specified by:
computeHeuristicin classAbstractPathJob- Returns:
- heuristic as a double - Manhatten Distance with tie-breaker.
-
isAtDestination
Checks if the destination has been reached. Meaning that the avoid distance has been reached.- Specified by:
isAtDestinationin classAbstractPathJob- Parameters:
n- Node to test.- Returns:
- true if so.
-
setPathingOptions
Description copied from class:AbstractPathJobSets the pathing options- Overrides:
setPathingOptionsin classAbstractPathJob- Parameters:
pathingOptions- the pathing options to set.
-
getDestination
public net.minecraft.core.BlockPos getDestination()Description copied from interface:IDestinationPathJobReturn the destination- Specified by:
getDestinationin interfaceIDestinationPathJob- Returns:
- destination
-