Class ParticleShaper
java.lang.Object
hm.zelha.particlesfx.shapers.parents.RotationHandler
hm.zelha.particlesfx.shapers.parents.ParticleShaper
- All Implemented Interfaces:
Shape
- Direct Known Subclasses:
ParticleCircle,ParticleCylinder,ParticleFluid,ParticleImage,ParticleLine,ParticlePolygon,ParticleSpiral,ParticleText
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.bukkit.scheduler.BukkitTaskprotected booleanprotected intprotected intprotected final org.bukkit.Locationprotected final List<Pair<ShapeDisplayMechanic, ShapeDisplayMechanic.Phase>> protected intprotected Particleprotected intprotected intprotected final org.bukkit.util.VectorFields inherited from class hm.zelha.particlesfx.shapers.parents.RotationHandler
centroid, compounds, lastRotatedAround, locations, originalCentroid, origins, rhLocationHelper, rhRotHelper, rhVectorHelper, rot, rot2, rotHelper -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddMechanic(ShapeDisplayMechanic.Phase phase, ShapeDisplayMechanic mechanic) Similar toConsumer
in the case of phasesShapeDisplayMechanic.Phase.BEFORE_ROTATIONandShapeDisplayMechanic.Phase.AFTER_ROTATIONthe given mechanic will run before the location is modified to display the next particle, allowing you to modify the addition vector however you want, though doing so may be very volatile
keep in mind that all changes to the given objects will be reflected in the display() method, and considering that the display() method often displays hundreds of particles, try to make sure the mechanic isn't very resource-intensive
ShapeDisplayMechanic.apply(Particle, Location, Vector, int)voidaddParticle(Particle particle, int particlesUntilDisplay) adds a particle for this shape to display after a certain amount of other particlesvoidadds a player for this shape to display to, defaults to all online players in the shape's world if the list is emptyvoidaddPlayer(org.bukkit.entity.Player player) adds a player for this shape to display to, defaults to all online players in the shape's world if the list is emptyprotected voidapplyMechanics(ShapeDisplayMechanic.Phase phase, Particle particle, org.bukkit.Location current, org.bukkit.util.Vector addition) clone()protected abstract ParticleShaperabstract voiddisplay()protected ParticleintgetDelay()intintintintgetSecondaryParticle(int index) intbooleanhasPlayer(org.bukkit.entity.Player player) booleanisAsync()booleanvoidremoveMechanic(int index) voidremoveParticle(int index) voidremovePlayer(int index) voidremovePlayer(org.bukkit.entity.Player player) setAsync(boolean async) setDelay(int delay) voidsetDisplayPosition(int position) sets the current position of the shape's animation
(aka, sets the tracker that tells the shape how many particles have been displayed until this point)voidsetParticle(Particle particle) voidsetParticleFrequency(int particleFrequency) setParticlesPerDisplay(int particlesPerDisplay) 0 means that the entire animation will be played when .display() is calledvoidsetWorld(org.bukkit.World world) start()stop()Methods inherited from class hm.zelha.particlesfx.shapers.parents.RotationHandler
addCompound, calculateCentroid, face, faceAroundLocation, getAroundAxisPitch, getAroundAxisRoll, getAroundAxisYaw, getAroundPitch, getAroundRoll, getAroundRotationOrder, getAroundYaw, getAxisPitch, getAxisRoll, getAxisYaw, getClonedCenter, getDirection, getLocationAmount, getLocations, getLocationsList, getPitch, getRoll, getRotationOrder, getTotalDistance, getWorld, getYaw, move, move, move, recalculateIfNeeded, removeCompound, rotate, rotateAroundLocation, scale, scale, setAroundAxisPitch, setAroundAxisRoll, setAroundAxisRotation, setAroundAxisYaw, setAroundPitch, setAroundRoll, setAroundRotation, setAroundRotationOrder, setAroundYaw, setAxisPitch, setAxisRoll, setAxisRotation, setAxisYaw, setPitch, setRoll, setRotation, setRotationOrder, setYawMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface hm.zelha.particlesfx.shapers.parents.Shape
face, faceAroundLocation, getAroundAxisPitch, getAroundAxisRoll, getAroundAxisYaw, getAroundPitch, getAroundRoll, getAroundRotationOrder, getAroundYaw, getAxisPitch, getAxisRoll, getAxisYaw, getClonedCenter, getLocationAmount, getLocations, getPitch, getRoll, getRotationOrder, getTotalDistance, getWorld, getYaw, move, move, move, rotate, rotateAroundLocation, scale, scale, setAroundAxisPitch, setAroundAxisRoll, setAroundAxisRotation, setAroundAxisYaw, setAroundPitch, setAroundRoll, setAroundRotation, setAroundRotationOrder, setAroundYaw, setAxisPitch, setAxisRoll, setAxisRotation, setAxisYaw, setPitch, setRoll, setRotation, setRotationOrder, setYaw
-
Field Details
-
secondaryParticles
-
mechanics
-
players
-
locationHelper
protected final org.bukkit.Location locationHelper -
vectorHelper
protected final org.bukkit.util.Vector vectorHelper -
animator
protected org.bukkit.scheduler.BukkitTask animator -
particle
-
async
protected boolean async -
particleFrequency
protected int particleFrequency -
particlesPerDisplay
protected int particlesPerDisplay -
currentCount
protected int currentCount -
overallCount
protected int overallCount -
delay
protected int delay
-
-
Constructor Details
-
ParticleShaper
-
-
Method Details
-
start
-
stop
-
clone
-
display
public abstract void display() -
cloneConstructor
-
getCurrentParticle
-
applyMechanics
protected void applyMechanics(ShapeDisplayMechanic.Phase phase, Particle particle, org.bukkit.Location current, org.bukkit.util.Vector addition) -
addParticle
Description copied from interface:Shapeadds a particle for this shape to display after a certain amount of other particles- Specified by:
addParticlein interfaceShape- Parameters:
particle- particle to addparticlesUntilDisplay- how many particles need to be displayed before this one
-
addMechanic
Description copied from interface:ShapeSimilar toConsumer
in the case of phasesShapeDisplayMechanic.Phase.BEFORE_ROTATIONandShapeDisplayMechanic.Phase.AFTER_ROTATIONthe given mechanic will run before the location is modified to display the next particle, allowing you to modify the addition vector however you want, though doing so may be very volatile
keep in mind that all changes to the given objects will be reflected in the display() method, and considering that the display() method often displays hundreds of particles, try to make sure the mechanic isn't very resource-intensive
ShapeDisplayMechanic.apply(Particle, Location, Vector, int)- Specified by:
addMechanicin interfaceShape- Parameters:
phase- phase that the mechanic should run atmechanic- mechanic to run during display
-
addPlayer
public void addPlayer(org.bukkit.entity.Player player) Description copied from interface:Shapeadds a player for this shape to display to, defaults to all online players in the shape's world if the list is empty -
addPlayer
Description copied from interface:Shapeadds a player for this shape to display to, defaults to all online players in the shape's world if the list is empty -
removeParticle
public void removeParticle(int index) - Specified by:
removeParticlein interfaceShape- Parameters:
index- index of particle in list (main particle is not in list)- See Also:
-
removeMechanic
public void removeMechanic(int index) - Specified by:
removeMechanicin interfaceShape- Parameters:
index- index of mechanic in list- See Also:
-
removePlayer
public void removePlayer(int index) - Specified by:
removePlayerin interfaceShape- Parameters:
index- index of player to remove from list- See Also:
-
removePlayer
public void removePlayer(org.bukkit.entity.Player player) - Specified by:
removePlayerin interfaceShape- Parameters:
player- player to remove from list- See Also:
-
hasPlayer
public boolean hasPlayer(org.bukkit.entity.Player player) -
setParticle
- Specified by:
setParticlein interfaceShape
-
setParticleFrequency
public void setParticleFrequency(int particleFrequency) - Specified by:
setParticleFrequencyin interfaceShape- Parameters:
particleFrequency- amount of times to display the particle per full animation
-
setParticlesPerDisplay
Description copied from interface:Shape0 means that the entire animation will be played when .display() is called- Specified by:
setParticlesPerDisplayin interfaceShape- Parameters:
particlesPerDisplay- amount of particles that will be shown per display
-
setAsync
-
setDelay
- Specified by:
setDelayin interfaceShape- Parameters:
delay- amount of ticks betweenShape.display()being called
-
setDisplayPosition
public void setDisplayPosition(int position) Description copied from interface:Shapesets the current position of the shape's animation
(aka, sets the tracker that tells the shape how many particles have been displayed until this point)- Specified by:
setDisplayPositionin interfaceShape- Parameters:
position- position for shape to display at
-
setWorld
public void setWorld(org.bukkit.World world) - Specified by:
setWorldin interfaceShape- Overrides:
setWorldin classRotationHandler
-
getParticle
- Specified by:
getParticlein interfaceShape
-
getSecondaryParticle
- Specified by:
getSecondaryParticlein interfaceShape- Parameters:
index- index of particle to get from the list- Returns:
- a pair of the particle and the amount of particles before it should be displayed
- See Also:
-
getParticleFrequency
public int getParticleFrequency()- Specified by:
getParticleFrequencyin interfaceShape
-
getParticlesPerDisplay
public int getParticlesPerDisplay()- Specified by:
getParticlesPerDisplayin interfaceShape- Returns:
- the amount of particles per display
- See Also:
-
getDelay
public int getDelay() -
getSecondaryParticleAmount
public int getSecondaryParticleAmount()- Specified by:
getSecondaryParticleAmountin interfaceShape- Returns:
- the amount of extra particles that this shape uses
- See Also:
-
getMechanicAmount
public int getMechanicAmount()- Specified by:
getMechanicAmountin interfaceShape- Returns:
- the amount of mechanics used by this shape
- See Also:
-
getPlayers
- Specified by:
getPlayersin interfaceShape- Returns:
- the UUIDs of all the players that this shape displays to. displays to all players if this list is empty
-
getPlayerAmount
public int getPlayerAmount()- Specified by:
getPlayerAmountin interfaceShape- Returns:
- amount of players this shape displays to
-
isAsync
public boolean isAsync() -
isRunning
public boolean isRunning()
-