Expand World.spawnParticle API and add Builder

Adds ability to control who receives it and who is the source/sender (vanish API)
the standard API is to send the packet to everyone in the world, which is ineffecient.

This adds a new Builder API which is much friendlier to use.
This commit is contained in:
Aikar
2017-08-29 23:58:48 -04:00
parent 623c56ab78
commit 2a57740d34
3 changed files with 645 additions and 1 deletions

View File

@ -206,6 +206,18 @@ public enum Particle implements Keyed {
return key;
}
// Paper start - Particle API expansion
/**
* Creates a {@link com.destroystokyo.paper.ParticleBuilder}
*
* @return a {@link com.destroystokyo.paper.ParticleBuilder} for the particle
*/
@NotNull
public com.destroystokyo.paper.ParticleBuilder builder() {
return new com.destroystokyo.paper.ParticleBuilder(this);
}
// Paper end
/**
* Options which can be applied to dust particles - a particle
* color and size.