Package wbs.utils.util.particles
Class NormalParticleEffect
java.lang.Object
wbs.utils.util.particles.WbsParticleEffect
wbs.utils.util.particles.NormalParticleEffect
A particle effect that mimics the default behaviour of particle spawning,
and works the same as the vanilla /particle command.
-
Nested Class Summary
Nested classes/interfaces inherited from class wbs.utils.util.particles.WbsParticleEffect
WbsParticleEffect.WbsParticleType -
Field Summary
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedNormalParticleEffect(org.bukkit.configuration.ConfigurationSection section, WbsSettings settings, String directory) Create this effect from a ConfigurationSection, logging errors in the given settings -
Method Summary
Modifier and TypeMethodDescriptionbuild()Generate the particle set based on current settings.clone()doublegetSpeed()Gets the speed provider directlydoublegetX()Gets the x provider directlydoublegetY()Gets the y provider directlydoublegetZ()Gets the z provider directlyplay(org.bukkit.Particle particle, org.bukkit.Location loc) Run the effect pattern at the given location with the given particle.play(org.bukkit.Particle particle, org.bukkit.Location loc, org.bukkit.entity.Player player) Run the effect pattern at the given location with the given particle.protected voidRefresh all providers for this object.setSpeed(double speed) setSpeed(NumProvider speed) Set the speed provider directlysetX(double x) Set the size of the region in the X axissetX(NumProvider x) Set the X size provider directlysetXYZ(double size) Set the size of the region in the all 3 axes, making the region a cubesetXYZ(org.bukkit.util.Vector xyz) Set the size of the region in each axis defined by the X, Y, and Z components of a given vectorsetXYZ(NumProvider size) Set the provider of all axes directlysetY(double y) Set the size of the region in the Y axissetY(NumProvider y) Set the Y size provider directlysetZ(double z) Set the size of the region in the Z axissetZ(NumProvider z) Set the Z size provider directlyvoidwriteToConfig(org.bukkit.configuration.ConfigurationSection section, String path) Save this effect in a config that can be read byWbsParticleEffect.buildParticleEffect(ConfigurationSection, WbsSettings, String)Methods inherited from class wbs.utils.util.particles.WbsParticleEffect
buildAndPlay, buildParticleEffect, cloneInto, filterChances, getAmount, getAmountProvider, getForce, getLocations, rand, scaleVector, setAmount, setAmount, setChance, setForce, setOptions, setPlugin
-
Constructor Details
-
NormalParticleEffect
public NormalParticleEffect() -
NormalParticleEffect
protected NormalParticleEffect(org.bukkit.configuration.ConfigurationSection section, WbsSettings settings, String directory) Create this effect from a ConfigurationSection, logging errors in the given settings- Parameters:
section- The section where this effect is definedsettings- The settings to log errors againstdirectory- The path taken through the config to get to this point, for logging purposes
-
-
Method Details
-
clone
- Specified by:
clonein classWbsParticleEffect
-
refreshProviders
protected void refreshProviders()Description copied from class:WbsParticleEffectRefresh all providers for this object. Subclasses may override this, but should call super.refreshProviders() at the start of the method- Overrides:
refreshProvidersin classWbsParticleEffect
-
build
Description copied from class:WbsParticleEffectGenerate the particle set based on current settings. Call this before the first time it is run, or call buildAndRun each time to run based on current settings.- Specified by:
buildin classWbsParticleEffect- Returns:
- The same object.
-
play
public NormalParticleEffect play(org.bukkit.Particle particle, org.bukkit.Location loc, org.bukkit.entity.Player player) Description copied from class:WbsParticleEffectRun the effect pattern at the given location with the given particle. For shapes needing two locations (such as Line), a random second location will be chosen a random number of blocks away from the given location.- Specified by:
playin classWbsParticleEffect- Parameters:
particle- The particle type to useloc- The location at which to run the effect.player- The only play who will see it- Returns:
- The same object.
-
play
Description copied from class:WbsParticleEffectRun the effect pattern at the given location with the given particle. For shapes needing two locations (such as Line), a random second location will be chosen a random number of blocks away from the given location.- Specified by:
playin classWbsParticleEffect- Parameters:
particle- The particle type to useloc- The location at which to run the effect.- Returns:
- The same object.
-
getSpeed
public double getSpeed()- Returns:
- The speed spawned particles will go in a random direction
-
getSpeedProvider
Gets the speed provider directly- Returns:
- The speed provider
-
setSpeed
- Parameters:
speed- The speed spawned particles will go in a random direction- Returns:
- The same particle effect
-
setSpeed
Set the speed provider directly- Parameters:
speed- The speed spawned particles will go in a random direction- Returns:
- The same particle effect
-
setX
Set the size of the region in the X axis- Parameters:
x- The new size in the X axis- Returns:
- The same particle effect
-
setY
Set the size of the region in the Y axis- Parameters:
y- The new size in the Y axis- Returns:
- The same particle effect
-
setZ
Set the size of the region in the Z axis- Parameters:
z- The new size in the Z axis- Returns:
- The same particle effect
-
setX
Set the X size provider directly- Parameters:
x- The new size in the X axis- Returns:
- The same particle effect
-
setY
Set the Y size provider directly- Parameters:
y- The new size in the Y axis- Returns:
- The same particle effect
-
setZ
Set the Z size provider directly- Parameters:
z- The new size in the Z axis- Returns:
- The same particle effect
-
setXYZ
Set the size of the region in the all 3 axes, making the region a cube- Parameters:
size- The new size in the all axes- Returns:
- The same particle effect
-
setXYZ
Set the provider of all axes directly- Parameters:
size- The new size in the all axes- Returns:
- The same particle effect
-
setXYZ
Set the size of the region in each axis defined by the X, Y, and Z components of a given vector- Parameters:
xyz- The vector representing the size of the region- Returns:
- The same particle effect
-
getX
public double getX()- Returns:
- The current X axis size of this particle
-
getY
public double getY()- Returns:
- The current Y axis size of this particle
-
getZ
public double getZ()- Returns:
- The current Z axis size of this particle
-
getXProvider
Gets the x provider directly- Returns:
- The x provider
-
getYProvider
Gets the y provider directly- Returns:
- The y provider
-
getZProvider
Gets the z provider directly- Returns:
- The z provider
-
writeToConfig
Description copied from class:WbsParticleEffectSave this effect in a config that can be read byWbsParticleEffect.buildParticleEffect(ConfigurationSection, WbsSettings, String)- Overrides:
writeToConfigin classWbsParticleEffect- Parameters:
section- The section to write topath- The field/path inside the given section
-