Package org.bukkit.util
Class BlockIterator
java.lang.Object
org.bukkit.util.BlockIterator
This class performs ray tracing and iterates along blocks on a line
- 
Constructor SummaryConstructorsConstructorDescriptionBlockIterator(@NotNull LivingEntity entity) Constructs the BlockIterator.BlockIterator(@NotNull LivingEntity entity, int maxDistance) Constructs the BlockIterator.Constructs the BlockIterator.BlockIterator(@NotNull Location loc, double yOffset) Constructs the BlockIterator.BlockIterator(@NotNull Location loc, double yOffset, int maxDistance) Constructs the BlockIterator.BlockIterator(@NotNull World world, @NotNull Vector start, @NotNull Vector direction, double yOffset, int maxDistance) Constructs the BlockIterator.
- 
Method SummaryMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.IteratorforEachRemaining
- 
Constructor Details- 
BlockIteratorpublic BlockIterator(@NotNull @NotNull World world, @NotNull @NotNull Vector start, @NotNull @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 tracing
- start- A Vector giving the initial location for the trace
- direction- A Vector pointing in the direction for the trace
- yOffset- The trace begins vertically offset from the start vector by this value
- maxDistance- 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
 
- 
BlockIteratorConstructs the BlockIterator.This considers all blocks as 1x1x1 in size. - Parameters:
- loc- The location for the start of the ray trace
- yOffset- The trace begins vertically offset from the start vector by this value
- maxDistance- 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
 
- 
BlockIteratorConstructs the BlockIterator.This considers all blocks as 1x1x1 in size. - Parameters:
- loc- The location for the start of the ray trace
- yOffset- The trace begins vertically offset from the start vector by this value
 
- 
BlockIteratorConstructs the BlockIterator.This considers all blocks as 1x1x1 in size. - Parameters:
- loc- The location for the start of the ray trace
 
- 
BlockIteratorConstructs the BlockIterator.This considers all blocks as 1x1x1 in size. - Parameters:
- entity- Information from the entity is used to set up the trace
- maxDistance- 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
 
- 
BlockIteratorConstructs 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- 
hasNextpublic boolean hasNext()Returns true if the iteration has more elements
- 
nextReturns the next Block in the trace- Specified by:
- nextin interface- Iterator<Block>
- Returns:
- the next Block in the trace
- Throws:
- NoSuchElementException
 
- 
removepublic void remove()
 
-