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 Summary
Modifier and TypeMethodDescriptionvoidcheckStuck(NAV navigator) Checks the entity for stuckstatic <NAV extends net.minecraft.world.entity.ai.navigation.PathNavigation & IMinecoloniesNavigator>
PathingStuckHandler<NAV>Creates a new stuck handlerintReturns the stuck level (0-9) indicating how long the entity is stuck and which stuck actions got usedvoidResets global stuck timerswithChanceToByPassMovingAway(double chance) withCompleteStuckBlockBreak(int range) Sets the block break range on complete stuckwithDelayBeforeStuckActions(int delay) Sets the delay before taking stuck actionswithTakeDamageOnStuck(float damagePct) withTeleportSteps(int steps) Enables teleporting a certain amount of steps along a generated pathwithTimePerBlockDistance(int time) Sets the time per block distance to travel, before timing out
-
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
Checks the entity for stuck- Specified by:
checkStuckin interfaceIStuckHandler<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:
resetGlobalStuckTimersin interfaceIStuckHandler<NAV extends net.minecraft.world.entity.ai.navigation.PathNavigation & IMinecoloniesNavigator>
-
withBlockBreaks
-
withPlaceLadders
-
withBuildLeafBridges
-
withChanceToByPassMovingAway
-
withTeleportSteps
Enables teleporting a certain amount of steps along a generated path- Parameters:
steps- steps to teleport- Returns:
- this
-
withTeleportOnFullStuck
-
withTakeDamageOnStuck
-
withTimePerBlockDistance
Sets the time per block distance to travel, before timing out- Parameters:
time- in ticks to set- Returns:
- this
-
withDelayBeforeStuckActions
Sets the delay before taking stuck actions- Parameters:
delay- to set- Returns:
- this
-
withCompleteStuckBlockBreak
Sets the block break range on complete stuck- Parameters:
range- to set- Returns:
- this
-
getStuckLevel
public int getStuckLevel()Description copied from interface:IStuckHandlerReturns the stuck level (0-9) indicating how long the entity is stuck and which stuck actions got used- Specified by:
getStuckLevelin interfaceIStuckHandler<NAV extends net.minecraft.world.entity.ai.navigation.PathNavigation & IMinecoloniesNavigator>- Returns:
-