Package org.bukkit.util
Class BlockIterator
java.lang.Object
org.bukkit.util.BlockIterator
public class BlockIterator extends Object implements Iterator<Block>
This class performs ray tracing and iterates along blocks on a line
-
Constructor Summary
Constructors Constructor Description BlockIterator(LivingEntity entity)
Constructs the BlockIterator.BlockIterator(LivingEntity entity, int maxDistance)
Constructs the BlockIterator.BlockIterator(Location loc)
Constructs the BlockIterator.BlockIterator(Location loc, double yOffset)
Constructs the BlockIterator.BlockIterator(Location loc, double yOffset, int maxDistance)
Constructs the BlockIterator.BlockIterator(World world, Vector start, Vector direction, double yOffset, int maxDistance)
Constructs the BlockIterator. -
Method Summary
-
Constructor Details
-
BlockIterator
public BlockIterator(@NotNull World world, @NotNull Vector start, @NotNull Vector direction, double yOffset, int maxDistance)Constructs the BlockIterator.This considers all blocks as 1x1x1 in size.
- Parameters:
world
- The world to use for tracingstart
- A Vector giving the initial location for the tracedirection
- A Vector pointing in the direction for the traceyOffset
- The trace begins vertically offset from the start vector by this valuemaxDistance
- This is the maximum distance in blocks for the trace. Setting this value above 140 may lead to problems with unloaded chunks. A value of 0 indicates no limit
-
BlockIterator
Constructs the BlockIterator.This considers all blocks as 1x1x1 in size.
- Parameters:
loc
- The location for the start of the ray traceyOffset
- The trace begins vertically offset from the start vector by this valuemaxDistance
- This is the maximum distance in blocks for the trace. Setting this value above 140 may lead to problems with unloaded chunks. A value of 0 indicates no limit
-
BlockIterator
Constructs the BlockIterator.This considers all blocks as 1x1x1 in size.
- Parameters:
loc
- The location for the start of the ray traceyOffset
- The trace begins vertically offset from the start vector by this value
-
BlockIterator
Constructs the BlockIterator.This considers all blocks as 1x1x1 in size.
- Parameters:
loc
- The location for the start of the ray trace
-
BlockIterator
Constructs the BlockIterator.This considers all blocks as 1x1x1 in size.
- Parameters:
entity
- Information from the entity is used to set up the tracemaxDistance
- This is the maximum distance in blocks for the trace. Setting this value above 140 may lead to problems with unloaded chunks. A value of 0 indicates no limit
-
BlockIterator
Constructs the BlockIterator.This considers all blocks as 1x1x1 in size.
- Parameters:
entity
- Information from the entity is used to set up the trace
-
-
Method Details