public class BlockRayBuilder extends Object
| Modifier and Type | Field and Description |
|---|---|
protected Material[] |
filter |
protected Material[] |
neededType |
protected List<Vector> |
positions |
| Constructor and Description |
|---|
BlockRayBuilder(Location position,
@Nullable Entity entity)
Create a new BlockRayBuilder
|
BlockRayBuilder(Location position,
Vector vector)
Create a new BlockRayBuilder
|
BlockRayBuilder(Player p)
Create a new BlockRayBuilder
|
| Modifier and Type | Method and Description |
|---|---|
BlockRay |
build()
Build BlockRay
Warn: this method have to be runned as sync. |
BlockRayBuilder |
filter(Material... filter)
Edit the filter of ray (block which are ignored)
|
BlockRayBuilder |
ignoreAir(boolean air)
Say if we have to ignore air
|
BlockRayBuilder |
maxDistance(int max)
Change the max ray distance
|
BlockRayBuilder |
neededPositions(List<Vector> vec)
Add searched position.
|
BlockRayBuilder |
neededPositions(Vector... vec)
Add searched position.
|
BlockRayBuilder |
neededType(Material... type)
Set a searched type.
|
BlockRayBuilder |
vector(Vector vec)
Edit the vector which correspond to ray direction
|
public BlockRayBuilder(Location position, @Nullable Entity entity)
position - the started position of rayentity - which will give the rotation (and so the vector)public BlockRayBuilder(Player p)
p - the player where the ray startpublic BlockRayBuilder ignoreAir(boolean air)
air - true if the ray ignore air blockspublic BlockRayBuilder neededType(Material... type)
type - all searched materialpublic BlockRayBuilder vector(Vector vec)
vec - the new direction vectorpublic BlockRayBuilder filter(Material... filter)
filter - All transparent type for raypublic BlockRayBuilder neededPositions(Vector... vec)
vec - searched positionspublic BlockRayBuilder neededPositions(List<Vector> vec)
vec - searched positionspublic BlockRayBuilder maxDistance(int max)
max - the max distance of raypublic BlockRay build()