Package valorless.rarespawns.datamodels
Class Particle
java.lang.Object
valorless.rarespawns.datamodels.Particle
Data model describing a particle spawn configuration.
Encapsulates the particle key and basic spawn parameters: count, offset and extra.
A convenience parse(String) method can construct an instance from a
compact string format.
-
Field Summary
FieldsModifier and TypeFieldDescriptionNumber of particle instances to spawn per call.Extra/speed parameter passed to the particle system.org.bukkit.ParticleNamespaced key or identifier of the particle to spawn (e.g.Offset applied to X/Y/Z when spawning, used as spread. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ParticleParses a particle specification string into a Particle instance.voidspawn(org.bukkit.entity.Player player) Spawns this particle at the player's current location.voidspawn(org.bukkit.Location location) Spawns this particle at the given world location.toString()Returns a human-readable description of this particle configuration.
-
Field Details
-
key
public org.bukkit.Particle keyNamespaced key or identifier of the particle to spawn (e.g. "FLAME"). -
count
Number of particle instances to spawn per call. -
offset
Offset applied to X/Y/Z when spawning, used as spread. -
extra
Extra/speed parameter passed to the particle system.
-
-
Constructor Details
-
Particle
Creates a particle configuration with explicit parameters.- Parameters:
key- particle identifier (e.g., Bukkit particle key or name)count- number of particles to spawnoffset- positional spread on each axisextra- extra/speed value for the particle
-
-
Method Details
-
parse
Parses a particle specification string into a Particle instance.Format:
key[:count[:offset[:extra]]]- key: required particle identifier
- count: integer (default 20)
- offset: double spread for x/y/z (default 0.5)
- extra: double extra/speed parameter (default 0.02)
- Parameters:
string- the particle specification string- Returns:
- a Particle instance with parsed or defaulted values
-
spawn
public void spawn(org.bukkit.entity.Player player) Spawns this particle at the player's current location.Uses the configured count, offset (applied to x/y/z as spread), and extra parameters.
- Parameters:
player- the player whose location is used for spawning
-
spawn
public void spawn(org.bukkit.Location location) Spawns this particle at the given world location.Uses the configured count, offset (applied to x/y/z as spread), and extra parameters.
- Parameters:
location- the target location for spawning particles
-
toString
Returns a human-readable description of this particle configuration.
-