public abstract class AbstractRayBuilder<T extends AbstractRayBuilder<T,R>,R extends AbstractRay<? extends AbstractRayResult<?>>> extends Object
| Modifier and Type | Field and Description |
|---|---|
protected int |
maxDistance |
protected Location |
position |
protected Vector |
vector |
protected World |
w |
| Constructor and Description |
|---|
AbstractRayBuilder(Location position,
@Nullable Entity entity)
Create a new RayBuilder
|
AbstractRayBuilder(Location position,
Vector vector)
Create a new RayBuilder
|
AbstractRayBuilder(Player p)
Create a new RayBuilder
|
| Modifier and Type | Method and Description |
|---|---|
abstract R |
build()
Build BlockRay
Warn: this method have to be runned as sync. |
T |
maxDistance(int max)
Change the max ray distance
|
T |
vector(Vector vec)
Edit the vector which correspond to ray direction
|
protected final World w
protected final Location position
protected Vector vector
protected int maxDistance
public AbstractRayBuilder(Location position, @Nullable Entity entity)
position - the started position of rayentity - which will give the rotation (and so the vector)public AbstractRayBuilder(Player p)
p - the player where the ray startpublic T vector(Vector vec)
vec - the new direction vectorpublic T maxDistance(int max)
max - the max distance of raypublic abstract R build()