Package wbs.utils.util.particles
Class LineParticleEffect
java.lang.Object
wbs.utils.util.particles.WbsParticleEffect
wbs.utils.util.particles.LineParticleEffect
A particle effect that spawns points on a line between two points
-
Nested Class Summary
Nested classes/interfaces inherited from class wbs.utils.util.particles.WbsParticleEffect
WbsParticleEffect.WbsParticleType -
Field Summary
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedLineParticleEffect(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()org.bukkit.util.VectorgetEnd()Gets the end point provider directlydoubleGets the radius provider directlybooleanbooleandoublegetSpeed()Gets the speed 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.play(org.bukkit.Particle particle, org.bukkit.Location start, org.bukkit.Location finish) Draws a line with particles between start and finishplay(org.bukkit.Particle particle, org.bukkit.Location start, org.bukkit.Location finish, org.bukkit.entity.Player player) Draws a line with particles between start and finishprotected voidRefresh all providers for this object.setEnd(org.bukkit.util.Vector end) setEnd(VectorProvider end) Set the end provider directlysetRadius(double radius) setRadius(NumProvider radius) Set the radius provider directlysetRandom(boolean random) setScaleAmount(boolean scaleAmount) setSpeed(double speed) setSpeed(NumProvider speed) Set the speed 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
-
LineParticleEffect
public LineParticleEffect() -
LineParticleEffect
protected LineParticleEffect(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
Run the effect pattern at the given location with the given particle. As Line needs a second location, this method generates a random second location within a radius of 1 of loc. Or, if the end position is set and random is false, the end location will be used.- Specified by:
playin classWbsParticleEffect- Parameters:
particle- The particle type to useloc- The location at which to run the effect.- Returns:
- The same particle effect
-
play
public LineParticleEffect 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. As Line needs a second location, this method generates a random second location within a radius of 1 of loc. Or, if the end position is set and random is false, the end location will be used.- Specified by:
playin classWbsParticleEffect- Parameters:
particle- The particle type to useloc- The location at which to run the effect.player- The player to see the particles- Returns:
- The same particle effect
-
play
public LineParticleEffect play(org.bukkit.Particle particle, org.bukkit.Location start, org.bukkit.Location finish, org.bukkit.entity.Player player) Draws a line with particles between start and finish- Parameters:
particle- The particle type to usestart- The location at which to run the effect.finish- The end of the line.player- The player to see the particles- Returns:
- The same particle effect
-
play
public LineParticleEffect play(org.bukkit.Particle particle, org.bukkit.Location start, org.bukkit.Location finish) Draws a line with particles between start and finish- Parameters:
particle- The particle type to usestart- The location at which to run the effect.finish- The end of the line.- Returns:
- The same particle effect
-
getRadius
public double getRadius()- Returns:
- The thickness of the line
-
getRadiusProvider
Gets the radius provider directly- Returns:
- The radius provider
-
setRadius
- Parameters:
radius- The thickness of the line- Returns:
- The same particle effect
-
setRadius
Set the radius provider directly- Parameters:
radius- The thickness of the line- Returns:
- The same particle effect
-
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
-
getScaleAmount
public boolean getScaleAmount()- Returns:
- Whether or not to use the amount value as points-block-block
-
setScaleAmount
- Parameters:
scaleAmount- Whether or not to use the amount value as points-block-block- Returns:
- The same particle effect
-
getRandom
public boolean getRandom()- Returns:
- Whether or not the other end of the line should be
random when
play(Particle, Location)is called without a second location. When false, the end point must have been set withsetEnd(Vector)
-
setRandom
- Parameters:
random- Whether or not the other end of the line should be random whenplay(Particle, Location)is called without a second location. When false, the end point must have been set withsetEnd(Vector)- Returns:
- The same particle effect
-
getEnd
public org.bukkit.util.Vector getEnd()- Returns:
- The end point to use when
setRandom(boolean)has been set to false
-
getEndProvider
Gets the end point provider directly- Returns:
- The end point provider
-
setEnd
- Parameters:
end- The end point to use whensetRandom(boolean)has been set to false- Returns:
- The same particle effect
-
setEnd
Set the end provider directly- Parameters:
end- The end point to use whensetRandom(boolean)has been set to false- 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
-