Class EntityNavigationUtils
java.lang.Object
com.minecolonies.core.entity.pathfinding.navigation.EntityNavigationUtils
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic intDistance to consider being near a building block as reachedstatic doubleDistance which counts as reachedstatic intDistance to consider being near a block inside a building as reached -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanwalkAwayFrom(AbstractFastMinecoloniesEntity entity, net.minecraft.core.BlockPos avoid, int distance, double speed) Walks away from a given positionstatic booleanwalkCloseToXNearY(AbstractFastMinecoloniesEntity entity, net.minecraft.core.BlockPos desiredPosition, net.minecraft.core.BlockPos nearbyPosition, int distToDesired, boolean safeDestination) Tries to walk close to a given pos, staying near another position.static booleanwalkCloseToXNearY(AbstractFastMinecoloniesEntity entity, net.minecraft.core.BlockPos desiredPosition, net.minecraft.core.BlockPos nearbyPosition, int distToDesired, boolean safeDestination, double speedFactor) Tries to walk close to a given pos, staying near another position.static booleanwalkToBuilding(AbstractFastMinecoloniesEntity entity, IBuilding building) Walks to a position within a buildingstatic booleanwalkToPos(AbstractFastMinecoloniesEntity entity, net.minecraft.core.BlockPos desiredPosition, boolean safeDestination) Walks to a given positionstatic booleanwalkToPos(AbstractFastMinecoloniesEntity entity, net.minecraft.core.BlockPos desiredPosition, int distToDesired, boolean safeDestination) Walks to a given positionstatic <T extends net.minecraft.world.entity.Mob>
booleanwalkToPos(T entity, net.minecraft.core.BlockPos desiredPosition, int distToDesired, boolean safeDestination, double speedFactor) Walks to a given positionstatic booleanwalkToPosInBuilding(AbstractFastMinecoloniesEntity entity, net.minecraft.core.BlockPos destination, IBuilding building, int reachDistance) Walks to a position within a buildingstatic booleanwalkToRandomPos(AbstractFastMinecoloniesEntity entity, int range, double speedFactor) Walks to a random position a given distance awaystatic booleanwalkToRandomPosAround(AbstractFastMinecoloniesEntity entity, net.minecraft.core.BlockPos center, int range, double speedFactor) Walks to a random position a given distance away around the provided centerstatic <T extends net.minecraft.world.entity.Mob>
booleanwalkToRandomPosAround(T entity, net.minecraft.core.BlockPos center, int range, double speedFactor) Walks to a random position a given distance away around the provided centerprotected static booleanwalkToRandomPosHelper(MinecoloniesAdvancedPathNavigate nav, net.minecraft.core.BlockPos center, int range, double speedFactor) Helper function to walk to a random position a given distance away around the provided center.static booleanwalkToRandomPosWithin(AbstractFastMinecoloniesEntity entity, int range, double speedFactor, net.minecraft.util.Tuple<net.minecraft.core.BlockPos, net.minecraft.core.BlockPos> corners) Walks to a random position a given distance away within the provided boxstatic booleanwalkToRandomPosWithin(AbstractFastMinecoloniesEntity entity, int range, double speedFactor, net.minecraft.util.Tuple<net.minecraft.core.BlockPos, net.minecraft.core.BlockPos> corners, boolean preferInside) Walks to a random position a given distance away within the provided box
-
Field Details
-
BUILDING_REACH_DIST
public static int BUILDING_REACH_DISTDistance to consider being near a building block as reached -
WOKR_IN_BUILDING_DIST
public static int WOKR_IN_BUILDING_DISTDistance to consider being near a block inside a building as reached -
REACHED_DIST
public static double REACHED_DISTDistance which counts as reached
-
-
Constructor Details
-
EntityNavigationUtils
public EntityNavigationUtils()
-
-
Method Details
-
walkCloseToXNearY
public static boolean walkCloseToXNearY(AbstractFastMinecoloniesEntity entity, net.minecraft.core.BlockPos desiredPosition, net.minecraft.core.BlockPos nearbyPosition, int distToDesired, boolean safeDestination) Tries to walk close to a given pos, staying near another position.- Parameters:
entity-desiredPosition-nearbyPosition-distToDesired-- Returns:
- True when arrived
-
walkCloseToXNearY
public static boolean walkCloseToXNearY(AbstractFastMinecoloniesEntity entity, net.minecraft.core.BlockPos desiredPosition, net.minecraft.core.BlockPos nearbyPosition, int distToDesired, boolean safeDestination, double speedFactor) Tries to walk close to a given pos, staying near another position.- Returns:
- True when arrived
-
walkToPosInBuilding
public static boolean walkToPosInBuilding(AbstractFastMinecoloniesEntity entity, net.minecraft.core.BlockPos destination, IBuilding building, int reachDistance) Walks to a position within a building- Returns:
- True when arrived
-
walkToBuilding
Walks to a position within a building- Returns:
- True when arrived
-
walkToPos
public static boolean walkToPos(AbstractFastMinecoloniesEntity entity, net.minecraft.core.BlockPos desiredPosition, boolean safeDestination) Walks to a given position- Returns:
- True when arrived
-
walkToPos
public static boolean walkToPos(AbstractFastMinecoloniesEntity entity, net.minecraft.core.BlockPos desiredPosition, int distToDesired, boolean safeDestination) Walks to a given position- Returns:
- True when arrived
-
walkToPos
public static <T extends net.minecraft.world.entity.Mob> boolean walkToPos(T entity, net.minecraft.core.BlockPos desiredPosition, int distToDesired, boolean safeDestination, double speedFactor) Walks to a given position- Returns:
- True when arrived
-
walkAwayFrom
public static boolean walkAwayFrom(AbstractFastMinecoloniesEntity entity, net.minecraft.core.BlockPos avoid, int distance, double speed) Walks away from a given position- Returns:
- True when arrived
-
walkToRandomPos
public static boolean walkToRandomPos(AbstractFastMinecoloniesEntity entity, int range, double speedFactor) Walks to a random position a given distance away- Returns:
- True when arrived
-
walkToRandomPosWithin
public static boolean walkToRandomPosWithin(AbstractFastMinecoloniesEntity entity, int range, double speedFactor, net.minecraft.util.Tuple<net.minecraft.core.BlockPos, net.minecraft.core.BlockPos> corners, boolean preferInside) Walks to a random position a given distance away within the provided box- Returns:
- True when arrived
-
walkToRandomPosWithin
public static boolean walkToRandomPosWithin(AbstractFastMinecoloniesEntity entity, int range, double speedFactor, net.minecraft.util.Tuple<net.minecraft.core.BlockPos, net.minecraft.core.BlockPos> corners) Walks to a random position a given distance away within the provided box- Returns:
- True when arrived
-
walkToRandomPosAround
public static boolean walkToRandomPosAround(AbstractFastMinecoloniesEntity entity, net.minecraft.core.BlockPos center, int range, double speedFactor) Walks to a random position a given distance away around the provided center- Returns:
- True when arrived
-
walkToRandomPosAround
public static <T extends net.minecraft.world.entity.Mob> boolean walkToRandomPosAround(T entity, net.minecraft.core.BlockPos center, int range, double speedFactor) Walks to a random position a given distance away around the provided center- Returns:
- True when arrived
-