Class PathingStuckHandler<NAV extends net.minecraft.world.entity.ai.navigation.PathNavigation & IMinecoloniesNavigator>

java.lang.Object
com.minecolonies.core.entity.pathfinding.navigation.PathingStuckHandler<NAV>
All Implemented Interfaces:
IStuckHandler<NAV>

public class PathingStuckHandler<NAV extends net.minecraft.world.entity.ai.navigation.PathNavigation & IMinecoloniesNavigator> extends Object implements IStuckHandler<NAV>
Stuck handler for pathing
  • Method Details

    • createStuckHandler

      public static <NAV extends net.minecraft.world.entity.ai.navigation.PathNavigation & IMinecoloniesNavigator> PathingStuckHandler<NAV> createStuckHandler()
      Creates a new stuck handler
      Returns:
      new stuck handler
    • checkStuck

      public void checkStuck(NAV navigator)
      Checks the entity for stuck
      Specified by:
      checkStuck in interface IStuckHandler<NAV extends net.minecraft.world.entity.ai.navigation.PathNavigation & IMinecoloniesNavigator>
      Parameters:
      navigator - navigator to check
    • resetGlobalStuckTimers

      public void resetGlobalStuckTimers()
      Resets global stuck timers
      Specified by:
      resetGlobalStuckTimers in interface IStuckHandler<NAV extends net.minecraft.world.entity.ai.navigation.PathNavigation & IMinecoloniesNavigator>
    • withBlockBreaks

      public PathingStuckHandler withBlockBreaks()
    • withPlaceLadders

      public PathingStuckHandler withPlaceLadders()
    • withBuildLeafBridges

      public PathingStuckHandler withBuildLeafBridges()
    • withChanceToByPassMovingAway

      public PathingStuckHandler withChanceToByPassMovingAway(double chance)
    • withTeleportSteps

      public PathingStuckHandler withTeleportSteps(int steps)
      Enables teleporting a certain amount of steps along a generated path
      Parameters:
      steps - steps to teleport
      Returns:
      this
    • withTeleportOnFullStuck

      public PathingStuckHandler withTeleportOnFullStuck()
    • withTakeDamageOnStuck

      public PathingStuckHandler withTakeDamageOnStuck(float damagePct)
    • withTimePerBlockDistance

      public PathingStuckHandler withTimePerBlockDistance(int time)
      Sets the time per block distance to travel, before timing out
      Parameters:
      time - in ticks to set
      Returns:
      this
    • withDelayBeforeStuckActions

      public PathingStuckHandler withDelayBeforeStuckActions(int delay)
      Sets the delay before taking stuck actions
      Parameters:
      delay - to set
      Returns:
      this
    • withCompleteStuckBlockBreak

      public PathingStuckHandler withCompleteStuckBlockBreak(int range)
      Sets the block break range on complete stuck
      Parameters:
      range - to set
      Returns:
      this
    • getStuckLevel

      public int getStuckLevel()
      Description copied from interface: IStuckHandler
      Returns the stuck level (0-9) indicating how long the entity is stuck and which stuck actions got used
      Specified by:
      getStuckLevel in interface IStuckHandler<NAV extends net.minecraft.world.entity.ai.navigation.PathNavigation & IMinecoloniesNavigator>
      Returns: