Class PathJobMoveToWithPassable
java.lang.Object
com.minecolonies.core.entity.pathfinding.pathjobs.AbstractPathJob
com.minecolonies.core.entity.pathfinding.pathjobs.PathJobMoveToLocation
com.minecolonies.core.entity.pathfinding.pathjobs.PathJobMoveToWithPassable
- All Implemented Interfaces:
IPathJob,IDestinationPathJob,Callable<net.minecraft.world.level.pathfinder.Path>
Moves to the given location, with a special passable check.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final doubleAdditional cost to special passing ruleFields inherited from class com.minecolonies.core.entity.pathfinding.pathjobs.PathJobMoveToLocation
destinationFields 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
ConstructorsConstructorDescriptionPathJobMoveToWithPassable(net.minecraft.world.level.Level world, @NotNull net.minecraft.core.BlockPos start, @NotNull net.minecraft.core.BlockPos end, int range, net.minecraft.world.entity.Mob entity, Function<net.minecraft.world.level.block.state.BlockState, Boolean> isPassable) Prepares the PathJob for the path finding system. -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanisPassable(@NotNull net.minecraft.world.level.block.state.BlockState block, int x, int y, int z, MNode parent, boolean head) Is the space passable.protected doublemodifyCost(double cost, MNode parent, boolean swimstart, boolean swimming, int x, int y, int z, net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.block.state.BlockState below) Modifies costs if needed for a nodeMethods inherited from class com.minecolonies.core.entity.pathfinding.pathjobs.PathJobMoveToLocation
computeHeuristic, getDestination, getEndNodeScore, isAtDestination, isJobFor, search, stopOnNodeLimit, toStringMethods inherited from class com.minecolonies.core.entity.pathfinding.pathjobs.AbstractPathJob
call, computeCost, exploreInDirection, getActualWorld, getEntity, getGroundHeight, getPathingOptions, getResult, getStart, handleDebugOptions, initDebug, isPassable, setPathingOptions, syncDebug, visitNode
-
Field Details
-
PASSING_COST
public static final double PASSING_COSTAdditional cost to special passing rule- See Also:
-
-
Constructor Details
-
PathJobMoveToWithPassable
public PathJobMoveToWithPassable(net.minecraft.world.level.Level world, @NotNull @NotNull net.minecraft.core.BlockPos start, @NotNull @NotNull net.minecraft.core.BlockPos end, int range, net.minecraft.world.entity.Mob entity, Function<net.minecraft.world.level.block.state.BlockState, Boolean> isPassable) Prepares the PathJob for the path finding system.- Parameters:
world- world the entity is in.start- starting location.end- target location.range- max search range.entity- the entity.isPassable- passable check
-
-
Method Details
-
isPassable
protected boolean isPassable(@NotNull @NotNull net.minecraft.world.level.block.state.BlockState block, int x, int y, int z, MNode parent, boolean head) Description copied from class:AbstractPathJobIs the space passable.- Overrides:
isPassablein classAbstractPathJob- Parameters:
block- the block we are checking.parent- the parent node.head- the head position.- Returns:
- true if the block does not block movement.
-
modifyCost
protected double modifyCost(double cost, MNode parent, boolean swimstart, boolean swimming, int x, int y, int z, net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.block.state.BlockState below) Description copied from class:AbstractPathJobModifies costs if needed for a node- Overrides:
modifyCostin classAbstractPathJob- Parameters:
cost-parent-swimstart-swimming-state-- Returns:
-