Package alexiil.mc.lib.attributes
Class SearchOptions
java.lang.Object
alexiil.mc.lib.attributes.SearchOptions
Various methods for creating
SearchOption instances.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final SearchOption<Object>ASearchOptionthat has no constraints, and will get every attribute instance that is obtainable without a direction. -
Method Summary
Modifier and TypeMethodDescriptionstatic SearchOptionDirectional<Object>inDirection(net.minecraft.util.math.Direction direction) static SearchOptionDirectionalVoxel<Object>inDirectionalVoxel(net.minecraft.util.math.Direction direction, net.minecraft.util.shape.VoxelShape shape) static <T> SearchOptionDirectionalVoxel<T>inDirectionalVoxelMatching(net.minecraft.util.math.Direction direction, net.minecraft.util.shape.VoxelShape shape, Predicate<T> matcher) static <T> SearchOptionDirectional<T>inDirectionMatching(net.minecraft.util.math.Direction direction, Predicate<T> matcher) static SearchOptionDirectionalVoxel<Object>inOrderedDirectionalVoxel(net.minecraft.util.math.Direction direction, net.minecraft.util.shape.VoxelShape shape) static <T> SearchOptionDirectionalVoxel<T>inOrderedDirectionalVoxelMatching(net.minecraft.util.math.Direction direction, net.minecraft.util.shape.VoxelShape shape, Predicate<T> matcher) static SearchOptionInVoxel<Object>inVoxel(net.minecraft.util.shape.VoxelShape shape) static <T> SearchOptionInVoxel<T>inVoxelMatching(net.minecraft.util.shape.VoxelShape shape, Predicate<T> matcher) static <T> SearchOption<T>
-
Field Details
-
ALL
ASearchOptionthat has no constraints, and will get every attribute instance that is obtainable without a direction. Note that you should never need to use this directly as every attribute getter method (likeAttribute.getAll(World, BlockPos, SearchOption)) will use this if null is passed.
-
-
Method Details
-
matching
- Returns:
- A
SearchOptionthat will only match attribute instances that pass the givenPredicatetest.
-
inDirection
public static SearchOptionDirectional<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
SearchOptionthat 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, 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
SearchOptionthat will only match attribute instances that offer themselves in the specified direction, and which pass the givenPredicatetest.
-
inVoxel
- Returns:
- A
SearchOptionthat will only match attribute instances thatintersectwith the givenVoxelShape.
-
inVoxelMatching
public static <T> SearchOptionInVoxel<T> inVoxelMatching(net.minecraft.util.shape.VoxelShape shape, Predicate<T> matcher) - Returns:
- A
SearchOptionthat will only match attribute instances thatintersectwith the givenVoxelShape, and and which pass the givenPredicatetest.
-
inDirectionalVoxel
public static SearchOptionDirectionalVoxel<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
SearchOptionthat will only match attribute instances that offer themselves in the specified direction, and whichintersectwith the givenVoxelShape, and and which pass the givenPredicatetest.
-
inDirectionalVoxelMatching
public static <T> SearchOptionDirectionalVoxel<T> inDirectionalVoxelMatching(net.minecraft.util.math.Direction direction, net.minecraft.util.shape.VoxelShape shape, 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
SearchOptionthat will only match attribute instances that:
-
inOrderedDirectionalVoxel
public static SearchOptionDirectionalVoxel<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
SearchOptionthat will only match attribute instances that offer themselves in the specified direction, and whichintersectwith the givenVoxelShape, and and which pass the givenPredicatetest.In addition this will sort the resulting
AttributeListthat are returned from methods likeAttribute.getAll(World, BlockPos, SearchOption)in the order that theirVoxelShapewill 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, 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
SearchOptionthat will only match attribute instances that:- Offer themselves in the specified direction
Intersectwith the givenVoxelShape- Pass the given
Predicatetest, and which
AttributeListthat are returned from methods likeAttribute.getAll(World, BlockPos, SearchOption)in the order that theirVoxelShapewill be encountered by the search.
-