Package de.slikey.effectlib
Class Effect
java.lang.Object
de.slikey.effectlib.Effect
- All Implemented Interfaces:
Runnable
- Direct Known Subclasses:
AnimatedBallEffect,ArcEffect,AtomEffect,BaseImageEffect,BigBangEffect,BleedEffect,CircleEffect,CloudEffect,ConeEffect,CubeEffect,CuboidEffect,CylinderEffect,DiscoBallEffect,DnaEffect,DonutEffect,DragonEffect,EarthEffect,EquationEffect,ExplodeEffect,FlameEffect,FountainEffect,GridEffect,HeartEffect,HelixEffect,HillEffect,IconEffect,JumpEffect,LineEffect,LoveEffect,ModifiedEffect,MusicEffect,ParticleEffect,PlotEffect,PyramidEffect,ShieldEffect,SmokeEffect,SoundEffect,SphereEffect,SquareEffect,StarEffect,TextEffect,TornadoEffect,TraceEffect,TurnEffect,VortexEffect,WarpEffect,WaveEffect
-
Field Summary
FieldsModifier and TypeFieldDescriptionintbooleanbooleanlongorg.bukkit.ColorList<org.bukkit.Color>intbooleanbooleanprotected final EffectManagerintorg.bukkit.Materialbyteprotected intorg.bukkit.util.Vectorprotected DynamicLocationorg.bukkit.Particleintfloatfloatfloatfloatfloatintfloatdoubleorg.bukkit.util.Vectorfloatintfloatorg.bukkit.configuration.ConfigurationSectionprotected Stringprotected DynamicLocationorg.bukkit.util.VectorList<org.bukkit.entity.Player>org.bukkit.ColorList<org.bukkit.Color>booleanbooleanfloatfloat -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidcancel()final voidcancel(boolean callback) booleanShould this effect stop playing if the origin entity becomes invalid?booleanShould this effect stop playing if the target entity becomes invalid?booleanIf set to false, Entity-bound directions will not update during the Effectprotected voiddisplay(org.bukkit.Particle effect, org.bukkit.Location location) protected voiddisplay(org.bukkit.Particle particle, org.bukkit.Location location, float speed, int amount) protected voiddisplay(org.bukkit.Particle particle, org.bukkit.Location location, org.bukkit.Color color) protected voiddisplay(org.bukkit.Particle particle, org.bukkit.Location location, org.bukkit.Color color, float speed, int amount) protected voiddisplay(org.bukkit.Particle particle, org.bukkit.Location location, org.bukkit.Color color, org.bukkit.Color toColor, float speed, int amount) intUsed only by the vibration particle in 1.17 and up.longCallback to run, after effect is done.org.bukkit.ColorgetColor()Can be used to colorize certain particles.List<org.bukkit.Color>intgetDelay()Interval to wait for repeating effects.Total duration of this effect in milliseconds.org.bukkit.entity.EntityExtending Effect classes can use this to determine the Entity this Effect is centered upon.intAmount of repetitions to do.final org.bukkit.LocationExtending Effect classes should use this method to obtain the current "root" Location of the effect.org.bukkit.MaterialThe Material and data to use for block and item break particlesbyteintThis will store the base number of iterationsorg.bukkit.util.VectorIf set, will offset the origin location.org.bukkit.ParticleParticleType of spawned particle.intfloatThis can be used to give particles a set speed when spawned.floatfloatfloatfloatUsed to scale up or down a particle's size.intAmount of repetitions to do.getPitch()floatdoubleProbability that this effect will play on each iteration.org.bukkit.util.VectorIf set, will offset the origin location, relative to the origin direction.floatUsed only by the sculk_charge particle in 1.19 and up.intUsed only by the shriek particle in 1.19 and up.floatgetSpeed()Deprecated.longorg.bukkit.configuration.ConfigurationSectionConfig section of subeffect to play at effect location.Class of subeffect to play at effect location.final org.bukkit.LocationExtending Effect classes should use this method to obtain the current "target" Location of the effect.org.bukkit.entity.EntityExtending Effect classes can use this to determine the Entity this Effect is targeted upon.org.bukkit.util.VectorIf set, will offset the target location.org.bukkit.entity.PlayerA specific player who should see this effect.List<org.bukkit.entity.Player>A group of players who should see this effect.org.bukkit.ColorUsed for dust particles in 1.17 and up, to make a color transition.List<org.bukkit.Color>getType()Type of effect being played.floatDisplay particles to players within this radius.getYaw()floatThese are used to modify the direction of the origin Location.final voidinfinite()protected voidbooleanIf set, will run asynchronously.booleanIf true, and a "target" Location or Entity is set, the two Locations will orient to face one another.final booleanisDone()booleanbooleanIf set to false, Entity-bound locations will not update during the EffectvoidonDone()Called when this effect is done playing (whendone()is called).abstract voidonRun()protected List<org.bukkit.Color>parseColorList(String colors) voidprepare()voidprotected voidreset()Effects should override this if they want to be reusable, this is called prior to starting so state can be reset.final voidrun()voidsetBlockData(String blockData) voidsetBlockDuration(long blockDuration) voidsetDynamicOrigin(DynamicLocation location) Set the Location this Effect is centered on.voidsetDynamicTarget(DynamicLocation location) Set the Location this Effect is targeting.voidsetEntity(org.bukkit.entity.Entity entity) voidsetLocation(org.bukkit.Location location) voidsetMaterial(org.bukkit.Material material) voidsetMaterialData(byte materialData) voidsetMaxIterations(int maxIterations) voidsetOrigin(DynamicLocation origin) voidsetParticleCount(int particleCount) voidsetParticleOffsetX(float particleOffsetX) voidsetParticleOffsetY(float particleOffsetY) voidsetParticleOffsetZ(float particleOffsetZ) voidsetParticleSize(float particleSize) voidsetStartTime(long startTime) voidsetTarget(org.bukkit.Location location) voidsetTargetEntity(org.bukkit.entity.Entity entity) voidsetTargetLocation(org.bukkit.Location location) Deprecated.voidsetTargetPlayer(org.bukkit.entity.Player targetPlayer) voidsetTargetPlayers(List<org.bukkit.entity.Player> targetPlayers) voidsetType(EffectType type) final voidstart()protected voidprotected voidprotected voidprotected final booleanvalidate()
-
Field Details
-
effectManager
-
subEffectClass
-
origin
-
target
-
maxIterations
protected int maxIterations -
type
-
particle
public org.bukkit.Particle particle -
color
public org.bukkit.Color color -
colorList
-
colors
-
toColor
public org.bukkit.Color toColor -
toColorList
-
toColors
-
shriekDelay
public int shriekDelay -
sculkChargeRotation
public float sculkChargeRotation -
arrivalTime
public int arrivalTime -
subEffect
public org.bukkit.configuration.ConfigurationSection subEffect -
speed
public float speed -
particleData
public float particleData -
delay
public int delay -
period
public int period -
iterations
public int iterations -
duration
-
probability
public double probability -
callback
-
visibleRange
public float visibleRange -
autoOrient
public boolean autoOrient -
offset
public org.bukkit.util.Vector offset -
relativeOffset
public org.bukkit.util.Vector relativeOffset -
targetOffset
public org.bukkit.util.Vector targetOffset -
yawOffset
public float yawOffset -
pitchOffset
public float pitchOffset -
yaw
-
pitch
-
updateLocations
public boolean updateLocations -
updateDirections
public boolean updateDirections -
targetPlayers
-
material
public org.bukkit.Material material -
materialData
public byte materialData -
blockData
-
blockDuration
public long blockDuration -
particleCount
public int particleCount -
particleOffsetX
public float particleOffsetX -
particleOffsetY
public float particleOffsetY -
particleOffsetZ
public float particleOffsetZ -
particleSize
public float particleSize -
asynchronous
public boolean asynchronous -
disappearWithOriginEntity
public boolean disappearWithOriginEntity -
disappearWithTargetEntity
public boolean disappearWithTargetEntity
-
-
Constructor Details
-
Effect
-
-
Method Details
-
getEffectManager
-
getType
Type of effect being played.- See Also:
-
getParticle
ParticleType of spawned particle. -
getColor
Can be used to colorize certain particles. As of 1.8, those include SPELL_MOB_AMBIENT, SPELL_MOB and REDSTONE. -
getColorList
-
getColors
-
getToColor
Used for dust particles in 1.17 and up, to make a color transition. -
getToColorList
-
getToColors
-
getShriekDelay
public int getShriekDelay()Used only by the shriek particle in 1.19 and up. -
getSculkChargeRotation
public float getSculkChargeRotation()Used only by the sculk_charge particle in 1.19 and up. -
getArrivalTime
public int getArrivalTime()Used only by the vibration particle in 1.17 and up. -
getSubEffectClass
Class of subeffect to play at effect location. -
getSubEffect
Config section of subeffect to play at effect location. -
getSpeed
Deprecated.This can be used to give particles a set speed when spawned. This will not work with colored particles. -
getParticleData
public float getParticleData()This can be used to give particles a set speed when spawned. This will not work with colored particles. This is a replacement for "speed" -
getDelay
public int getDelay()Interval to wait for repeating effects.- See Also:
-
getPeriod
public int getPeriod()Amount of repetitions to do. Set this to -1 for an infinite effect- See Also:
-
getIterations
public int getIterations()Amount of repetitions to do. Set this to -1 for an infinite effect- See Also:
-
getDuration
Total duration of this effect in milliseconds. If set, this will adjust iterations to match the defined delay such that the effect lasts a specific duration. -
getProbability
public double getProbability()Probability that this effect will play on each iteration. -
getCallback
Callback to run, after effect is done.- See Also:
-
getVisibleRange
public float getVisibleRange()Display particles to players within this radius. -
isAutoOrient
public boolean isAutoOrient()If true, and a "target" Location or Entity is set, the two Locations will orient to face one another. -
getOffset
public org.bukkit.util.Vector getOffset()If set, will offset the origin location. -
getRelativeOffset
public org.bukkit.util.Vector getRelativeOffset()If set, will offset the origin location, relative to the origin direction. -
getTargetOffset
public org.bukkit.util.Vector getTargetOffset()If set, will offset the target location. -
getYawOffset
public float getYawOffset()These are used to modify the direction of the origin Location. -
getPitchOffset
public float getPitchOffset() -
getYaw
-
getPitch
-
isUpdateLocations
public boolean isUpdateLocations()If set to false, Entity-bound locations will not update during the Effect -
canUpdateDirections
public boolean canUpdateDirections()If set to false, Entity-bound directions will not update during the Effect -
getTargetPlayer
public org.bukkit.entity.Player getTargetPlayer()A specific player who should see this effect. -
setTargetPlayer
public void setTargetPlayer(org.bukkit.entity.Player targetPlayer) -
getTargetPlayers
A group of players who should see this effect. -
setTargetPlayers
-
getMaterial
public org.bukkit.Material getMaterial()The Material and data to use for block and item break particles -
setMaterial
public void setMaterial(org.bukkit.Material material) -
setType
-
getMaterialData
public byte getMaterialData() -
setMaterialData
public void setMaterialData(byte materialData) -
getBlockData
-
setBlockData
-
getBlockDuration
public long getBlockDuration() -
setBlockDuration
public void setBlockDuration(long blockDuration) -
getParticleCount
public int getParticleCount() -
setParticleCount
public void setParticleCount(int particleCount) -
getParticleOffsetX
public float getParticleOffsetX() -
setParticleOffsetX
public void setParticleOffsetX(float particleOffsetX) -
getParticleOffsetY
public float getParticleOffsetY() -
setParticleOffsetY
public void setParticleOffsetY(float particleOffsetY) -
getParticleOffsetZ
public float getParticleOffsetZ() -
setParticleOffsetZ
public void setParticleOffsetZ(float particleOffsetZ) -
getParticleSize
public float getParticleSize()Used to scale up or down a particle's size. This currently only works with the REDSTONE particle in 1.13 and up. -
setParticleSize
public void setParticleSize(float particleSize) -
isAsynchronous
public boolean isAsynchronous()If set, will run asynchronously. Some effects don't support this (TurnEffect, JumpEffect) Generally this shouldn't be changed, unless you want to make an async effect synchronous. -
getEntity
public org.bukkit.entity.Entity getEntity()Extending Effect classes can use this to determine the Entity this Effect is centered upon. This may return null, even for an Effect that was set with an Entity, if the Entity gets GC'd. -
setEntity
public void setEntity(org.bukkit.entity.Entity entity) -
getTargetEntity
public org.bukkit.entity.Entity getTargetEntity()Extending Effect classes can use this to determine the Entity this Effect is targeted upon. This is probably a very rare case, such as an Effect that "links" two Entities together somehow. (Idea!) This may return null, even for an Effect that was set with a target Entity, if the Entity gets GC'd. -
setTargetEntity
public void setTargetEntity(org.bukkit.entity.Entity entity) -
getLocation
public final org.bukkit.Location getLocation()Extending Effect classes should use this method to obtain the current "root" Location of the effect. This method will not return null when called from onRun. Effects with invalid locations will be cancelled. -
setLocation
public void setLocation(org.bukkit.Location location) -
getTarget
public final org.bukkit.Location getTarget()Extending Effect classes should use this method to obtain the current "target" Location of the effect. Unlike getLocation, this may return null. -
setTarget
public void setTarget(org.bukkit.Location location) -
setTargetLocation
public void setTargetLocation(org.bukkit.Location location) Deprecated. -
getDynamicOrigin
-
setDynamicOrigin
Set the Location this Effect is centered on. -
getDynamicTarget
-
setDynamicTarget
Set the Location this Effect is targeting. -
getOrigin
-
setOrigin
-
getMaxIterations
public int getMaxIterations()This will store the base number of iterations -
setMaxIterations
public void setMaxIterations(int maxIterations) -
canDisappearWithOriginEntity
public boolean canDisappearWithOriginEntity()Should this effect stop playing if the origin entity becomes invalid? -
canDisappearWithTargetEntity
public boolean canDisappearWithTargetEntity()Should this effect stop playing if the target entity becomes invalid? -
isDone
public final boolean isDone() -
isPlaying
public boolean isPlaying() -
getStartTime
public long getStartTime() -
setStartTime
public void setStartTime(long startTime) -
parseColorList
-
initialize
protected void initialize() -
cancel
public final void cancel() -
cancel
public final void cancel(boolean callback) -
onRun
public abstract void onRun() -
onDone
public void onDone()Called when this effect is done playing (whendone()is called). -
run
public final void run() -
reset
protected void reset()Effects should override this if they want to be reusable, this is called prior to starting so state can be reset. -
prepare
public void prepare() -
start
public final void start() -
infinite
public final void infinite() -
validate
protected final boolean validate() -
updateDuration
protected void updateDuration() -
updateLocation
protected void updateLocation() -
updateTarget
protected void updateTarget() -
display
protected void display(org.bukkit.Particle effect, org.bukkit.Location location) -
display
protected void display(org.bukkit.Particle particle, org.bukkit.Location location, org.bukkit.Color color) -
display
protected void display(org.bukkit.Particle particle, org.bukkit.Location location, float speed, int amount) -
display
protected void display(org.bukkit.Particle particle, org.bukkit.Location location, org.bukkit.Color color, float speed, int amount) -
display
protected void display(org.bukkit.Particle particle, org.bukkit.Location location, org.bukkit.Color color, org.bukkit.Color toColor, float speed, int amount) -
reloadParameters
public void reloadParameters()
-
setTarget(Location)