public class TargetBlock
extends java.lang.Object
Originally written by toi. It was ported to WorldEdit and trimmed down by sk89q. Thanks to Raphfrk for optimization of toi's original class.
Constructor and Description |
---|
TargetBlock(Player player)
Constructor requiring a player, uses default values.
|
TargetBlock(Player player,
int maxDistance,
double checkDistance)
Constructor requiring a player, max distance and a checking distance.
|
Modifier and Type | Method and Description |
---|---|
Location |
getAnyTargetBlock()
Returns any block at the sight.
|
Location |
getAnyTargetBlockFace() |
Location |
getCurrentBlock()
Returns the current block along the line of vision.
|
Location |
getNextBlock()
Get next block.
|
Location |
getPreviousBlock()
Returns the previous block in the aimed path.
|
Location |
getSolidTargetBlock()
Returns the block at the sight.
|
Location |
getTargetBlock()
Returns the block at the sight.
|
Location |
getTargetBlockFace() |
void |
setSolidMask(Mask solidMask)
Set the mask used for determine where to stop solid block traces.
|
void |
setStopMask(Mask stopMask)
Set the mask used for determine where to stop traces.
|
public TargetBlock(Player player)
player
- player to work withpublic TargetBlock(Player player, int maxDistance, double checkDistance)
player
- Player to work withmaxDistance
- how far it checks for blockscheckDistance
- how often to check for blocks, the smaller the more precisepublic void setStopMask(@Nullable Mask stopMask)
stopMask
- the mask used to stop tracespublic void setSolidMask(@Nullable Mask solidMask)
solidMask
- the mask used to stop solid block tracespublic Location getAnyTargetBlock()
public Location getTargetBlock()
public Location getSolidTargetBlock()
public Location getNextBlock()
public Location getCurrentBlock()
public Location getPreviousBlock()
public Location getAnyTargetBlockFace()
public Location getTargetBlockFace()