Class SearchOptions

java.lang.Object
alexiil.mc.lib.attributes.SearchOptions

public final class SearchOptions
extends java.lang.Object
Various methods for creating SearchOption instances.
  • Field Details

  • Method Details

    • matching

      public static <T> SearchOption<T> matching​(java.util.function.Predicate<T> matcher)
      Returns:
      A SearchOption that will only match attribute instances that pass the given Predicate test.
    • inDirection

      public static SearchOptionDirectional<java.lang.Object> inDirection​(net.minecraft.util.math.Direction direction)
      Parameters:
      direction - The direction to search in - in other words the direction from the block that is searching to the block that is being searched.
      Returns:
      A SearchOption that will only match attribute instances that offer themselves in the specified direction.
    • inDirectionMatching

      public static <T> SearchOptionDirectional<T> inDirectionMatching​(net.minecraft.util.math.Direction direction, java.util.function.Predicate<T> matcher)
      Parameters:
      direction - The direction to search in - in other words the direction from the block that is searching to the block that is being searched.
      Returns:
      A SearchOption that will only match attribute instances that offer themselves in the specified direction, and which pass the given Predicate test.
    • inVoxel

      public static SearchOptionInVoxel<java.lang.Object> inVoxel​(net.minecraft.util.shape.VoxelShape shape)
      Returns:
      A SearchOption that will only match attribute instances that intersect with the given VoxelShape.
    • inVoxelMatching

      public static <T> SearchOptionInVoxel<T> inVoxelMatching​(net.minecraft.util.shape.VoxelShape shape, java.util.function.Predicate<T> matcher)
      Returns:
      A SearchOption that will only match attribute instances that intersect with the given VoxelShape, and and which pass the given Predicate test.
    • inDirectionalVoxel

      public static SearchOptionDirectionalVoxel<java.lang.Object> inDirectionalVoxel​(net.minecraft.util.math.Direction direction, net.minecraft.util.shape.VoxelShape shape)
      Parameters:
      direction - The direction to search in - in other words the direction from the block that is searching to the block that is being searched.
      Returns:
      A SearchOption that will only match attribute instances that offer themselves in the specified direction, and which intersect with the given VoxelShape, and and which pass the given Predicate test.
    • inDirectionalVoxelMatching

      public static <T> SearchOptionDirectionalVoxel<T> inDirectionalVoxelMatching​(net.minecraft.util.math.Direction direction, net.minecraft.util.shape.VoxelShape shape, java.util.function.Predicate<T> matcher)
      Parameters:
      direction - The direction to search in - in other words the direction from the block that is searching to the block that is being searched.
      Returns:
      A SearchOption that will only match attribute instances that:
      • Offer themselves in the specified direction
      • Intersect with the given VoxelShape
      • Pass the given Predicate test, and which
    • inOrderedDirectionalVoxel

      public static SearchOptionDirectionalVoxel<java.lang.Object> inOrderedDirectionalVoxel​(net.minecraft.util.math.Direction direction, net.minecraft.util.shape.VoxelShape shape)
      Parameters:
      direction - The direction to search in - in other words the direction from the block that is searching to the block that is being searched.
      Returns:
      A SearchOption that will only match attribute instances that offer themselves in the specified direction, and which intersect with the given VoxelShape, and and which pass the given Predicate test.

      In addition this will sort the resulting AttributeList that are returned from methods like Attribute.getAll(World, BlockPos, SearchOption) in the order that their VoxelShape will be encountered by the directional search.

    • inOrderedDirectionalVoxelMatching

      public static <T> SearchOptionDirectionalVoxel<T> inOrderedDirectionalVoxelMatching​(net.minecraft.util.math.Direction direction, net.minecraft.util.shape.VoxelShape shape, java.util.function.Predicate<T> matcher)
      Parameters:
      direction - The direction to search in - in other words the direction from the block that is searching to the block that is being searched.
      Returns:
      A SearchOption that will only match attribute instances that:
      • Offer themselves in the specified direction
      • Intersect with the given VoxelShape
      • Pass the given Predicate test, and which
      In addition this will sort the resulting AttributeList that are returned from methods like Attribute.getAll(World, BlockPos, SearchOption) in the order that their VoxelShape will be encountered by the search.