Package wbs.utils.util.particles
Class ElectricParticleEffect
java.lang.Object
wbs.utils.util.particles.WbsParticleEffect
wbs.utils.util.particles.ElectricParticleEffect
A particle effect that spawns many small lines in a
random pattern around a location, similar to sparks
-
Nested Class Summary
Nested classes/interfaces inherited from class wbs.utils.util.particles.WbsParticleEffect
WbsParticleEffect.WbsParticleType -
Field Summary
-
Constructor Summary
ConstructorsModifierConstructorDescriptionCreates the effect with the following values: Radius: 0.5 Speed: 0 Arc Length: 0.25 Ticks: 2protectedElectricParticleEffect(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()doubleGets the arc length directlydoubleGets the radius provider directlydoublegetSpeed()Gets the speed provider directlyintgetTicks()play(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, @Nullable org.bukkit.entity.Player player) Run the effect pattern at the given location with the given particle.protected voidRefresh all providers for this object.setArcLength(double arcLength) setArcLength(NumProvider arcLength) Set the arc length directlysetRadius(double radius) setRadius(NumProvider radius) Set the radius provider directlysetSpeed(double speed) setSpeed(NumProvider speed) Set the speed provider directlysetTicks(int ticks) setTicks(NumProvider ticks) Set the ticks 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
-
ElectricParticleEffect
public ElectricParticleEffect()Creates the effect with the following values:- Radius: 0.5
- Speed: 0
- Arc Length: 0.25
- Ticks: 2
-
ElectricParticleEffect
protected ElectricParticleEffect(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 ElectricParticleEffect play(org.bukkit.Particle particle, org.bukkit.Location loc, @Nullable @Nullable 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.
-
getRadius
public double getRadius()- Returns:
- The radius within which arcs can appear
-
getRadiusProvider
Gets the radius provider directly- Returns:
- The radius provider
-
setRadius
- Parameters:
radius- The radius within which arcs can appear- Returns:
- The same particle effect
-
setRadius
Set the radius provider directly- Parameters:
radius- The radius within which arcs can appear- Returns:
- The same particle effect
-
getSpeed
public double getSpeed()- Returns:
- The speed of spawned particles in a random direction
-
getSpeedProvider
Gets the speed provider directly- Returns:
- The speed provider
-
setSpeed
- Parameters:
speed- The speed of spawned particles in a random direction- Returns:
- The same particle effect
-
setSpeed
Set the speed provider directly- Parameters:
speed- The speed of spawned particles in a random direction- Returns:
- The same particle effect
-
getArcLength
public double getArcLength()- Returns:
- How long the spawned arcs should be
-
getArcLengthProvider
Gets the arc length directly- Returns:
- The arc length provider
-
setArcLength
- Parameters:
arcLength- How long the spawned arcs should be- Returns:
- The same particle effect
-
setArcLength
Set the arc length directly- Parameters:
arcLength- How long the spawned arcs should be- Returns:
- The same particle effect
-
getTicks
public int getTicks()- Returns:
- How many ticks to play the effect for
-
setTicks
- Parameters:
ticks- How many ticks to play the effect for- Returns:
- The same particle effect
-
setTicks
Set the ticks provider directly- Parameters:
ticks- How many ticks to play the effect for- Returns:
- The same particle effect
-
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
-