Bukkit  1.5.2-R1.0
 All Classes Namespaces Files Functions Variables Enumerator Pages
org.bukkit.util.BlockIterator Class Reference

This class performs ray tracing and iterates along blocks on a line. More...

+ Inheritance diagram for org.bukkit.util.BlockIterator:
+ Collaboration diagram for org.bukkit.util.BlockIterator:

Public Member Functions

 BlockIterator (World world, Vector start, Vector direction, double yOffset, int maxDistance)
 Constructs the BlockIterator.
 
 BlockIterator (Location loc, double yOffset, int maxDistance)
 Constructs the BlockIterator.
 
 BlockIterator (Location loc, double yOffset)
 Constructs the BlockIterator.
 
 BlockIterator (Location loc)
 Constructs the BlockIterator.
 
 BlockIterator (LivingEntity entity, int maxDistance)
 Constructs the BlockIterator.
 
 BlockIterator (LivingEntity entity)
 Constructs the BlockIterator.
 
boolean hasNext ()
 Returns true if the iteration has more elements.
 
Block next ()
 Returns the next Block in the trace.
 
void remove ()
 

Detailed Description

This class performs ray tracing and iterates along blocks on a line.

Definition at line 18 of file BlockIterator.java.

Constructor & Destructor Documentation

org.bukkit.util.BlockIterator.BlockIterator ( World  world,
Vector  start,
Vector  direction,
double  yOffset,
int  maxDistance 
)

Constructs the BlockIterator.

Parameters
worldThe world to use for tracing
startA Vector giving the initial location for the trace
directionA Vector pointing in the direction for the trace
yOffsetThe trace begins vertically offset from the start vector by this value
maxDistanceThis 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

Definition at line 53 of file BlockIterator.java.

References org.bukkit.util.Vector.clone(), org.bukkit.World.getBlockAt(), org.bukkit.block.BlockFace.getOppositeFace(), org.bukkit.block.Block.getRelative(), org.bukkit.util.Vector.getX(), org.bukkit.util.Vector.getY(), org.bukkit.util.Vector.getZ(), and org.bukkit.util.Vector.setY().

org.bukkit.util.BlockIterator.BlockIterator ( Location  loc,
double  yOffset,
int  maxDistance 
)

Constructs the BlockIterator.

Parameters
locThe location for the start of the ray trace
yOffsetThe trace begins vertically offset from the start vector by this value
maxDistanceThis 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

Definition at line 230 of file BlockIterator.java.

References org.bukkit.Location.getDirection(), org.bukkit.Location.getWorld(), and org.bukkit.Location.toVector().

org.bukkit.util.BlockIterator.BlockIterator ( Location  loc,
double  yOffset 
)

Constructs the BlockIterator.

Parameters
locThe location for the start of the ray trace
yOffsetThe trace begins vertically offset from the start vector by this value

Definition at line 241 of file BlockIterator.java.

References org.bukkit.Location.getDirection(), org.bukkit.Location.getWorld(), and org.bukkit.Location.toVector().

org.bukkit.util.BlockIterator.BlockIterator ( Location  loc)

Constructs the BlockIterator.

Parameters
locThe location for the start of the ray trace

Definition at line 251 of file BlockIterator.java.

org.bukkit.util.BlockIterator.BlockIterator ( LivingEntity  entity,
int  maxDistance 
)

Constructs the BlockIterator.

Parameters
entityInformation from the entity is used to set up the trace
maxDistanceThis 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

Definition at line 263 of file BlockIterator.java.

References org.bukkit.entity.LivingEntity.getEyeHeight(), and org.bukkit.entity.Entity.getLocation().

org.bukkit.util.BlockIterator.BlockIterator ( LivingEntity  entity)

Constructs the BlockIterator.

Parameters
entityInformation from the entity is used to set up the trace

Definition at line 273 of file BlockIterator.java.

Member Function Documentation

boolean org.bukkit.util.BlockIterator.hasNext ( )

Returns true if the iteration has more elements.

Definition at line 281 of file BlockIterator.java.

Block org.bukkit.util.BlockIterator.next ( )

Returns the next Block in the trace.

Returns
the next Block in the trace

Definition at line 292 of file BlockIterator.java.

void org.bukkit.util.BlockIterator.remove ( )

Definition at line 301 of file BlockIterator.java.


The documentation for this class was generated from the following file: