Package wbs.utils.util.particles
Class VelocityParticleEffect
java.lang.Object
wbs.utils.util.particles.WbsParticleEffect
wbs.utils.util.particles.VelocityParticleEffect
- Direct Known Subclasses:
CircleParticleEffect,CuboidParticleEffect
A superclass for particle effects that can have speed set in specific
directions
-
Nested Class Summary
Nested classes/interfaces inherited from class wbs.utils.util.particles.WbsParticleEffect
WbsParticleEffect.WbsParticleType -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected VectorProviderprotected booleanprotected NumProviderprotected NumProvider -
Constructor Summary
ConstructorsConstructorDescriptionVelocityParticleEffect(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 TypeMethodDescriptionprotected VelocityParticleEffectcloneInto(VelocityParticleEffect cloned) org.bukkit.util.VectorbooleandoublegetSpeed()doubleplay(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.setDirection(org.bukkit.util.Vector direction) setDirection(VectorProvider direction) setRelative(boolean relative) setSpeed(double speed) setSpeed(NumProvider speed) setVariation(double variation) setVariation(NumProvider variation) voidwriteToConfig(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
build, buildAndPlay, buildParticleEffect, clone, cloneInto, filterChances, getAmount, getAmountProvider, getForce, getLocations, rand, scaleVector, setAmount, setAmount, setChance, setForce, setOptions, setPlugin
-
Field Details
-
direction
-
speed
-
variation
-
relative
protected boolean relative
-
-
Constructor Details
-
VelocityParticleEffect
public VelocityParticleEffect() -
VelocityParticleEffect
public VelocityParticleEffect(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
-
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
-
cloneInto
-
play
public VelocityParticleEffect 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() -
getSpeedProvider
-
setSpeed
-
setSpeed
-
getDirection
public org.bukkit.util.Vector getDirection() -
getDirectionProvider
-
setDirection
-
setDirection
-
getVariation
public double getVariation() -
getVariationProvider
-
setVariation
- Parameters:
variation- The variation in direction when the particles have speed.- Returns:
- The same object.
-
setVariation
- Parameters:
variation- The variation in direction when the particles have speed.- Returns:
- The same object.
-
getRelative
public boolean getRelative()- Returns:
- Whether or not the velocity is relative to the origin of the particle effect.
-
setRelative
- Parameters:
relative- Whether or not this effect should be relative to the origin of the particle effect.- Returns:
- The same object.
-
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
-