Class EntityNavigationUtils

java.lang.Object
com.minecolonies.core.entity.pathfinding.navigation.EntityNavigationUtils

public class EntityNavigationUtils extends Object
  • Field Details

    • BUILDING_REACH_DIST

      public static int BUILDING_REACH_DIST
      Distance to consider being near a building block as reached
    • WOKR_IN_BUILDING_DIST

      public static int WOKR_IN_BUILDING_DIST
      Distance to consider being near a block inside a building as reached
    • REACHED_DIST

      public static double REACHED_DIST
      Distance 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

      public static boolean walkToBuilding(AbstractFastMinecoloniesEntity entity, IBuilding building)
      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
    • walkToRandomPosHelper

      protected static boolean walkToRandomPosHelper(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.
      Parameters:
      nav - the navigation to use
      center - the center of the random position
      range - the range of the random position
      speedFactor - the speed factor to use
      Returns:
      true if an acceptible destination has been reached.