public class ParticleBuilder extends Object
World.spawnParticle(Particle, Location, int, double, double, double, double, Object)
APIConstructor | Description |
---|---|
ParticleBuilder(Particle particle) |
Modifier and Type | Method | Description |
---|---|---|
ParticleBuilder |
allPlayers() |
Sends this particle to all players in the world.
|
ParticleBuilder |
color(int r,
int g,
int b) |
Sets the particle Color.
|
ParticleBuilder |
color(Color color) |
Sets the particle Color.
|
ParticleBuilder |
color(Color color,
float size) |
Sets the particle Color and size.
|
int |
count() |
|
ParticleBuilder |
count(int count) |
Sets the number of particles to spawn
|
<T> T |
data() |
Gets the particle custom data.
|
<T> ParticleBuilder |
data(T data) |
Sets the particle custom data.
|
double |
extra() |
Gets the Particle extra data.
|
ParticleBuilder |
extra(double extra) |
Sets the particle extra data.
|
ParticleBuilder |
force(boolean force) |
Sets whether the particle is forcefully shown to the player.
|
boolean |
hasReceivers() |
Example use:
builder.receivers(16); if (builder.hasReceivers()) { sendParticleAsync(builder); }
|
Location |
location() |
|
ParticleBuilder |
location(Location location) |
Sets the location of where to spawn the particle
|
ParticleBuilder |
location(World world,
double x,
double y,
double z) |
Sets the location of where to spawn the particle
|
ParticleBuilder |
offset(double offsetX,
double offsetY,
double offsetZ) |
Sets the particle offset.
|
double |
offsetX() |
Particle offset X.
|
double |
offsetY() |
Particle offset Y.
|
double |
offsetZ() |
Particle offset Z.
|
Particle |
particle() |
|
ParticleBuilder |
particle(Particle particle) |
Changes what particle will be sent
|
List<Player> |
receivers() |
|
ParticleBuilder |
receivers(int radius) |
Selects all players within a cuboid selection around the particle location, within the
specified bounding box.
|
ParticleBuilder |
receivers(int radius,
boolean byDistance) |
Selects all players within the specified radius around the particle location.
|
ParticleBuilder |
receivers(int xzRadius,
int yRadius) |
Selects all players within a cuboid selection around the particle location, within the
specified bounding box.
|
ParticleBuilder |
receivers(int xzRadius,
int yRadius,
boolean byDistance) |
Selects all players within the specified radius around the particle location.
|
ParticleBuilder |
receivers(int xRadius,
int yRadius,
int zRadius) |
Selects all players within a cuboid selection around the particle location, within the
specified bounding box.
|
ParticleBuilder |
receivers(Collection<Player> receivers) |
|
ParticleBuilder |
receivers(List<Player> receivers) |
|
ParticleBuilder |
receivers(Player... receivers) |
|
Player |
source() |
|
ParticleBuilder |
source(Player source) |
Sets the source of this particle for visibility concerns (Vanish API)
|
ParticleBuilder |
spawn() |
Sends the particle to all receiving players (or all).
|
public ParticleBuilder(@NotNull Particle particle)
@NotNull public ParticleBuilder spawn()
@NotNull public Particle particle()
@NotNull public ParticleBuilder particle(@NotNull Particle particle)
particle
- The particle@Nullable public List<Player> receivers()
public boolean hasReceivers()
@NotNull public ParticleBuilder allPlayers()
@NotNull public ParticleBuilder receivers(@Nullable List<Player> receivers)
receivers
- List of players to receive this particle, or null for all players in the
world@NotNull public ParticleBuilder receivers(@Nullable Collection<Player> receivers)
receivers
- List of players to receive this particle, or null for all players in the
world@NotNull public ParticleBuilder receivers(@Nullable Player... receivers)
receivers
- List of players to be receive this particle, or null for all players in the
world@NotNull public ParticleBuilder receivers(int radius)
receivers(int,
boolean)
radius
- amount to add on all axis@NotNull public ParticleBuilder receivers(int radius, boolean byDistance)
receivers(int, int)
If byDistance is
true, radius is tested by distance in a spherical shaperadius
- amount to add on each axisbyDistance
- true to use a spherical radius, false to use a cuboid@NotNull public ParticleBuilder receivers(int xzRadius, int yRadius)
receivers(int, int, boolean)
If you want a more spherical check,
see receivers(int, boolean)
xzRadius
- amount to add on the x/z axisyRadius
- amount to add on the y axis@NotNull public ParticleBuilder receivers(int xzRadius, int yRadius, boolean byDistance)
receivers(int, int)
If byDistance is
true, radius is tested by distance on the y plane and on the x/z plane, in a cylinder shape.xzRadius
- amount to add on the x/z axisyRadius
- amount to add on the y axisbyDistance
- true to use a cylinder shape, false to use cuboid@NotNull public ParticleBuilder receivers(int xRadius, int yRadius, int zRadius)
receivers(int, int,
boolean)
If you want a more spherical check, see receivers(int, boolean)
xRadius
- amount to add on the x axisyRadius
- amount to add on the y axiszRadius
- amount to add on the z axis@Nullable public Player source()
@NotNull public ParticleBuilder source(@Nullable Player source)
source
- The player who is considered the source@Nullable public Location location()
@NotNull public ParticleBuilder location(@NotNull Location location)
location
- The location of the particle@NotNull public ParticleBuilder location(@NotNull World world, double x, double y, double z)
world
- World to spawn particle inx
- X locationy
- Y locationz
- Z locationpublic int count()
@NotNull public ParticleBuilder count(int count)
count
- Number of particlespublic double offsetX()
public double offsetY()
public double offsetZ()
@NotNull public ParticleBuilder offset(double offsetX, double offsetY, double offsetZ)
offsetX
- Particle offset XoffsetY
- Particle offset YoffsetZ
- Particle offset Zpublic double extra()
@NotNull public ParticleBuilder extra(double extra)
extra
- the extra particle data@Nullable public <T> T data()
T
- The Particle data type@NotNull public <T> ParticleBuilder data(@Nullable T data)
T
- The Particle data typedata
- The new particle data@NotNull public ParticleBuilder force(boolean force)
force
- true to force, false for normal@NotNull public ParticleBuilder color(@Nullable Color color)
color
- the new particle color@NotNull public ParticleBuilder color(@Nullable Color color, float size)
color
- the new particle colorsize
- the size of the particle@NotNull public ParticleBuilder color(int r, int g, int b)
r
- red color componentg
- green color componentb
- blue color componentCopyright © 2020. All rights reserved.