Class AbstractAdvancedPathNavigate

java.lang.Object
net.minecraft.world.entity.ai.navigation.PathNavigation
net.minecraft.world.entity.ai.navigation.GroundPathNavigation
com.minecolonies.core.entity.pathfinding.navigation.AbstractAdvancedPathNavigate
Direct Known Subclasses:
MinecoloniesAdvancedPathNavigate

public abstract class AbstractAdvancedPathNavigate extends net.minecraft.world.entity.ai.navigation.GroundPathNavigation
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected @Nullable net.minecraft.core.BlockPos
     
    protected final net.minecraft.world.entity.Mob
     
    protected double
     

    Fields inherited from class net.minecraft.world.entity.ai.navigation.PathNavigation

    hasDelayedRecomputation, lastStuckCheck, lastStuckCheckPos, lastTimeoutCheck, level, maxDistanceToWaypoint, mob, nodeEvaluator, path, speedModifier, tick, timeLastRecompute, timeoutCachedNode, timeoutLimit, timeoutTimer
  • Constructor Summary

    Constructors
    Constructor
    Description
    AbstractAdvancedPathNavigate(net.minecraft.world.entity.Mob entityLiving, net.minecraft.world.level.Level worldIn)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    net.minecraft.world.entity.Mob
    Get the entity of this navigator
    Get the pathing options
    abstract PathResult
    Gets the current path result
    protected abstract PathResult<? extends IPathJob>
    moveAwayFromLivingEntity(net.minecraft.world.entity.Entity target, double distance, double combatMovementSpeed)
    Used to path away from a ourEntity.
    protected abstract void
    setPauseTicks(int pauseTicks)
    Sets the navigation to not accept new jobs for a time
    abstract void
    setSafeDestinationPos(net.minecraft.core.BlockPos pos)
    Sets the desired position to reach, used also for stuckhandling
    abstract void
    Sets the stuck handler for this navigator
    abstract void
    setSwimSpeedFactor(double factor)
     
    protected abstract PathResult<? extends IPathJob>
    walkAwayFrom(net.minecraft.core.BlockPos currentPosition, double range, double speed, boolean safeDestination)
    Used to path away from a position.
    walkCloseToXNearY(net.minecraft.core.BlockPos desiredPosition, net.minecraft.core.BlockPos nearbyPosition, int distToDesired, double speedFactor, boolean safeDestination)
    Walks towards the desired position, while trying to not steer too far from the nearby position
    protected abstract boolean
    walkTo(net.minecraft.core.BlockPos position, double speed)
    Attempt to move to a specific pos.
    protected abstract PathResult<? extends IPathJob>
    walkTo(net.minecraft.core.BlockPos pos, double speed, boolean safeDestination)
    Try to move to a certain position.
    protected abstract PathResult<? extends IPathJob>
    walkToEntity(@NotNull net.minecraft.world.entity.Entity e, double speed)
    Used to walk a living ourEntity with a speed.
    protected abstract PathResult<? extends IPathJob>
    walkToRandomPos(int range, double speed)
    Used to path towards a random pos.
    protected abstract PathResult<? extends IPathJob>
    walkToRandomPos(int range, double speed, net.minecraft.util.Tuple<net.minecraft.core.BlockPos,net.minecraft.core.BlockPos> corners)
    Used to path towards a random pos within some restrictions
    protected abstract PathResult<PathJobRandomPos>
    walkToRandomPos(int range, double speed, net.minecraft.util.Tuple<net.minecraft.core.BlockPos,net.minecraft.core.BlockPos> corners, boolean preferInside)
    Used to path towards a random pos within some restrictions
    protected abstract PathResult<? extends IPathJob>
    walkToRandomPosAround(int range, double speed, net.minecraft.core.BlockPos pos)
    Used to path towards a random pos.
    walkToTree(int range, double speed, List<ItemStorage> excludedTrees, int dyntreesize, IColony colony)
    Used to find a tree.
    walkToTree(net.minecraft.core.BlockPos startRestriction, net.minecraft.core.BlockPos endRestriction, double speed, List<ItemStorage> excludedTrees, int dyntreesize, IColony colony)
    Used to find a tree.
    protected abstract @Nullable PathResult<AbstractPathJob>
    walkTowards(net.minecraft.core.BlockPos towards, double range, double speedFactor)
    Attemps to move in the given direction, walking at least range blocks

    Methods inherited from class net.minecraft.world.entity.ai.navigation.GroundPathNavigation

    canOpenDoors, canPassDoors, canUpdatePath, createPath, createPath, createPathFinder, getTempMobPos, hasValidPathType, setAvoidSun, setCanOpenDoors, setCanPassDoors, setCanWalkOverFences, trimPath

    Methods inherited from class net.minecraft.world.entity.ai.navigation.PathNavigation

    canCutCorner, canFloat, canMoveDirectly, createPath, createPath, createPath, createPath, createPath, createPath, doStuckDetection, followThePath, getGroundY, getMaxDistanceToWaypoint, getNodeEvaluator, getPath, getTargetPos, isClearForMovementBetween, isDone, isInLiquid, isInProgress, isStableDestination, isStuck, moveTo, moveTo, moveTo, recomputePath, resetMaxVisitedNodesMultiplier, setCanFloat, setMaxVisitedNodesMultiplier, setSpeedModifier, shouldRecomputePath, stop, tick

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • ourEntity

      protected final net.minecraft.world.entity.Mob ourEntity
    • walkSpeedFactor

      protected double walkSpeedFactor
    • originalDestination

      @Nullable protected @Nullable net.minecraft.core.BlockPos originalDestination
  • Constructor Details

    • AbstractAdvancedPathNavigate

      public AbstractAdvancedPathNavigate(net.minecraft.world.entity.Mob entityLiving, net.minecraft.world.level.Level worldIn)
  • Method Details

    • walkAwayFrom

      protected abstract PathResult<? extends IPathJob> walkAwayFrom(net.minecraft.core.BlockPos currentPosition, double range, double speed, boolean safeDestination)
      Used to path away from a position.
      Parameters:
      currentPosition - the position to avoid.
      range - the range he should move out of.
      speed - the speed to run at.
      safeDestination - if the destination is save and should be set.
      Returns:
      the result of the pathing.
    • walkTo

      protected abstract PathResult<? extends IPathJob> walkTo(net.minecraft.core.BlockPos pos, double speed, boolean safeDestination)
      Try to move to a certain position.
      Parameters:
      x - the x target.
      y - the y target.
      z - the z target.
      speed - the speed to walk.
      Returns:
      the PathResult.
    • moveAwayFromLivingEntity

      protected abstract PathResult<? extends IPathJob> moveAwayFromLivingEntity(net.minecraft.world.entity.Entity target, double distance, double combatMovementSpeed)
      Used to path away from a ourEntity.
      Parameters:
      target - the ourEntity.
      distance - the distance to move to.
      combatMovementSpeed - the speed to run at.
      Returns:
      the result of the pathing.
    • walkTo

      protected abstract boolean walkTo(net.minecraft.core.BlockPos position, double speed)
      Attempt to move to a specific pos.
      Parameters:
      position - the position to move to.
      speed - the speed.
      Returns:
      true if successful.
    • walkTowards

      @Nullable protected abstract @Nullable PathResult<AbstractPathJob> walkTowards(net.minecraft.core.BlockPos towards, double range, double speedFactor)
      Attemps to move in the given direction, walking at least range blocks
      Parameters:
      towards -
      range -
      speedFactor -
      Returns:
    • walkToRandomPos

      protected abstract PathResult<? extends IPathJob> walkToRandomPos(int range, double speed)
      Used to path towards a random pos.
      Parameters:
      range - the range he should move out of.
      speed - the speed to run at.
      Returns:
      the result of the pathing.
    • walkToRandomPosAround

      protected abstract PathResult<? extends IPathJob> walkToRandomPosAround(int range, double speed, net.minecraft.core.BlockPos pos)
      Used to path towards a random pos.
      Parameters:
      range - the range he should move out of.
      speed - the speed to run at.
      pos - the pos to circle around.
      Returns:
      the result of the pathing.
    • walkCloseToXNearY

      protected abstract PathResult<PathJobMoveCloseToXNearY> walkCloseToXNearY(net.minecraft.core.BlockPos desiredPosition, net.minecraft.core.BlockPos nearbyPosition, int distToDesired, double speedFactor, boolean safeDestination)
      Walks towards the desired position, while trying to not steer too far from the nearby position
      Parameters:
      desiredPosition -
      nearbyPosition -
      distToDesired -
      speedFactor -
      safeDestination -
      Returns:
    • walkToRandomPos

      protected abstract PathResult<? extends IPathJob> walkToRandomPos(int range, double speed, net.minecraft.util.Tuple<net.minecraft.core.BlockPos,net.minecraft.core.BlockPos> corners)
      Used to path towards a random pos within some restrictions
      Parameters:
      range - the range he should move out of.
      speed - the speed to run at.
      corners - the corners they can't leave.
      Returns:
      the result of the pathing.
    • walkToRandomPos

      protected abstract PathResult<PathJobRandomPos> walkToRandomPos(int range, double speed, net.minecraft.util.Tuple<net.minecraft.core.BlockPos,net.minecraft.core.BlockPos> corners, boolean preferInside)
      Used to path towards a random pos within some restrictions
      Parameters:
      range - the range he should move out of.
      speed - the speed to run at.
      corners - the corners they can't leave.
      Returns:
      the result of the pathing.
    • walkToTree

      public abstract TreePathResult walkToTree(net.minecraft.core.BlockPos startRestriction, net.minecraft.core.BlockPos endRestriction, double speed, List<ItemStorage> excludedTrees, int dyntreesize, IColony colony)
      Used to find a tree.
      Parameters:
      startRestriction - the start of the restricted area.
      endRestriction - the end of the restricted area.
      speed - walking speed.
      excludedTrees - the trees which should be cut.
      Returns:
      the result of the search.
    • walkToTree

      public abstract TreePathResult walkToTree(int range, double speed, List<ItemStorage> excludedTrees, int dyntreesize, IColony colony)
      Used to find a tree.
      Parameters:
      range - in the range.
      speed - walking speed.
      excludedTrees - the trees which should be cut.
      Returns:
      the result of the search.
    • walkToEntity

      protected abstract PathResult<? extends IPathJob> walkToEntity(@NotNull @NotNull net.minecraft.world.entity.Entity e, double speed)
      Used to walk a living ourEntity with a speed.
      Parameters:
      e - the ourEntity.
      speed - the speed.
      Returns:
      the result.
    • getPathingOptions

      public PathingOptions getPathingOptions()
      Get the pathing options
      Returns:
      the pathing options.
    • getOurEntity

      public net.minecraft.world.entity.Mob getOurEntity()
      Get the entity of this navigator
      Returns:
      mobentity
    • setSafeDestinationPos

      public abstract void setSafeDestinationPos(net.minecraft.core.BlockPos pos)
      Sets the desired position to reach, used also for stuckhandling
      Parameters:
      pos -
    • setStuckHandler

      public abstract void setStuckHandler(IStuckHandler stuckHandler)
      Sets the stuck handler for this navigator
      Parameters:
      stuckHandler - handler to use
    • setSwimSpeedFactor

      public abstract void setSwimSpeedFactor(double factor)
    • setPauseTicks

      protected abstract void setPauseTicks(int pauseTicks)
      Sets the navigation to not accept new jobs for a time
      Parameters:
      pauseTicks -
    • getPathResult

      public abstract PathResult getPathResult()
      Gets the current path result
      Returns: