public class BlockRayBuilder extends AbstractRayBuilder<BlockRayBuilder,BlockRay>
Modifier and Type | Field and Description |
---|---|
protected Material[] |
filter |
protected Material[] |
neededType |
protected List<Vector> |
positions |
maxDistance, position, vector, w
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 |
neededPositions(List<Vector> vec)
Add searched position.
|
BlockRayBuilder |
neededPositions(Vector... vec)
Add searched position.
|
BlockRayBuilder |
neededType(Material... type)
Set a searched type.
|
maxDistance, vector
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 filter(Material... filter)
filter
- All transparent type for raypublic BlockRayBuilder neededPositions(Vector... vec)
vec
- searched positionspublic BlockRayBuilder neededPositions(List<Vector> vec)
vec
- searched positionspublic BlockRay build()
build
in class AbstractRayBuilder<BlockRayBuilder,BlockRay>