E - The type of the extent for the block raypublic static class BlockRay.BlockRayBuilder<E extends Extent> extends Object implements Iterable<BlockRayHit<E>>
Iterable, making it
useful for 'advanced for loops'. Use BlockRay.from(Location) to get an instance.| Modifier and Type | Method and Description |
|---|---|
BlockRay<E> |
build()
Returns a block ray build from the settings.
|
BlockRay.BlockRayBuilder<E> |
direction(com.flowpowered.math.vector.Vector3d direction)
Sets the direction.
|
BlockRay.BlockRayBuilder<E> |
distanceLimit(double distanceLimit)
Sets the maximum distance before stopping.
|
Optional<BlockRayHit<E>> |
end()
Iterates the built block ray until the end
and returns the last hit, if any.
|
Iterator<BlockRayHit<E>> |
iterator() |
BlockRay.BlockRayBuilder<E> |
narrowPhase(boolean enable)
Sets whether or not to perform narrow phase intersections.
|
com.flowpowered.math.vector.Vector3d |
position()
Gets the starting position of the block ray.
|
BlockRay.BlockRayBuilder<E> |
skipFilter(Predicate<BlockRayHit<E>>... skipFilters)
Adds filters to the block ray.
|
BlockRay.BlockRayBuilder<E> |
skipFilter(Predicate<BlockRayHit<E>> skipFilter)
Adds the filter to the block ray.
|
BlockRay.BlockRayBuilder<E> |
stopFilter(Predicate<BlockRayHit<E>>... stopFilters)
Adds filters to the block ray.
|
BlockRay.BlockRayBuilder<E> |
stopFilter(Predicate<BlockRayHit<E>> stopFilter)
Adds the filter to the block ray.
|
BlockRay.BlockRayBuilder<E> |
to(com.flowpowered.math.vector.Vector3d end)
Sets the direction and ending location.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic BlockRay.BlockRayBuilder<E> skipFilter(Predicate<BlockRayHit<E>> skipFilter)
skipFilter - The filter to add@SafeVarargs public final BlockRay.BlockRayBuilder<E> skipFilter(Predicate<BlockRayHit<E>>... skipFilters)
skipFilters - The filters to addpublic BlockRay.BlockRayBuilder<E> stopFilter(Predicate<BlockRayHit<E>> stopFilter)
stopFilter - The filter to add@SafeVarargs public final BlockRay.BlockRayBuilder<E> stopFilter(Predicate<BlockRayHit<E>>... stopFilters)
stopFilters - The filters to addpublic BlockRay.BlockRayBuilder<E> to(com.flowpowered.math.vector.Vector3d end)
end - The ending locationpublic BlockRay.BlockRayBuilder<E> direction(com.flowpowered.math.vector.Vector3d direction)
direction - The directionpublic BlockRay.BlockRayBuilder<E> distanceLimit(double distanceLimit)
distanceLimit - The distance limitpublic BlockRay.BlockRayBuilder<E> narrowPhase(boolean enable)
enable - Whether or not to enable the narrow phasepublic com.flowpowered.math.vector.Vector3d position()
public BlockRay<E> build()
public Iterator<BlockRayHit<E>> iterator()
iterator in interface Iterable<BlockRayHit<E extends Extent>>public Optional<BlockRayHit<E>> end()
build(),
BlockRay.end()