Package alexiil.mc.lib.attributes
Class SearchOptions
java.lang.Object
alexiil.mc.lib.attributes.SearchOptions
Various methods for creating
SearchOption
instances.-
Field Summary
Modifier and TypeFieldDescriptionstatic final SearchOption<Object>
ASearchOption
that 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
ASearchOption
that 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
SearchOption
that will only match attribute instances that pass the givenPredicate
test
.
-
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
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, 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 givenPredicate
test
.
-
inVoxel
- Returns:
- A
SearchOption
that will only match attribute instances thatintersect
with the givenVoxelShape
.
-
inVoxelMatching
public static <T> SearchOptionInVoxel<T> inVoxelMatching(net.minecraft.util.shape.VoxelShape shape, Predicate<T> matcher) - Returns:
- A
SearchOption
that will only match attribute instances thatintersect
with the givenVoxelShape
, and and which pass the givenPredicate
test
.
-
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
SearchOption
that will only match attribute instances that offer themselves in the specified direction, and whichintersect
with the givenVoxelShape
, and and which pass the givenPredicate
test
.
-
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
SearchOption
that 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
SearchOption
that will only match attribute instances that offer themselves in the specified direction, and whichintersect
with the givenVoxelShape
, and and which pass the givenPredicate
test
.In addition this will sort the resulting
AttributeList
that are returned from methods likeAttribute.getAll(World, BlockPos, SearchOption)
in the order that theirVoxelShape
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, 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 givenVoxelShape
- Pass the given
Predicate
test
, and which
AttributeList
that are returned from methods likeAttribute.getAll(World, BlockPos, SearchOption)
in the order that theirVoxelShape
will be encountered by the search.
-