Package hm.zelha.particlesfx.util
Class ParticleShapeCompound
java.lang.Object
hm.zelha.particlesfx.shapers.parents.RotationHandler
hm.zelha.particlesfx.util.ParticleShapeCompound
- All Implemented Interfaces:
Shape
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanFields 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 emptyvoidvoidAdds the given shape to this ParticleShapeCompound under the given name, so that you can easily access the shape viagetShape(String)clone()voiddisplay()intgetDelay()Deprecated.intDeprecated.Deprecated.intintintgetSecondaryParticle(int index) Deprecated.intDeprecated.getShape(int index) intShape[]booleanhasPlayer(org.bukkit.entity.Player player) booleanisAsync()Deprecated.booleanprotected booleanrecalculateIfNeeded(org.bukkit.Location around) voidremoveMechanic(int index) voidremoveParticle(int index) voidremovePlayer(int index) voidremovePlayer(org.bukkit.entity.Player player) voidremoveShape(int index) voidremoveShape(String name) Removes the shape with the given name from this ParticleShapeCompound. will do nothing if there are no shapes with the given namevoidscale(double x, double y, double z) Rescales this shape such that a shape with the xyz radiuses of 4, 3, 4, resized by 1.25, 1.25, 1.25, would have its radiuses become 5, 3.75, 5.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 calledstart()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, removeCompound, rotate, rotateAroundLocation, scale, setAroundAxisPitch, setAroundAxisRoll, setAroundAxisRotation, setAroundAxisYaw, setAroundPitch, setAroundRoll, setAroundRotation, setAroundRotationOrder, setAroundYaw, setAxisPitch, setAxisRoll, setAxisRotation, setAxisYaw, setPitch, setRoll, setRotation, setRotationOrder, setWorld, 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, setAroundAxisPitch, setAroundAxisRoll, setAroundAxisRotation, setAroundAxisYaw, setAroundPitch, setAroundRoll, setAroundRotation, setAroundRotationOrder, setAroundYaw, setAxisPitch, setAxisRoll, setAxisRotation, setAxisYaw, setPitch, setRoll, setRotation, setRotationOrder, setWorld, setYaw
-
Field Details
-
shapeLocationIndex
-
nameMap
-
recalc
protected boolean recalc
-
-
Constructor Details
-
ParticleShapeCompound
-
-
Method Details
-
start
-
stop
-
display
public void display() -
clone
-
scale
public void scale(double x, double y, double z) Description copied from interface:ShapeRescales this shape such that a shape with the xyz radiuses of 4, 3, 4, resized by 1.25, 1.25, 1.25, would have its radiuses become 5, 3.75, 5.- Specified by:
scalein interfaceShape- Overrides:
scalein classRotationHandler- Parameters:
x- x scaley- y scalez- z scale
-
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
-
getParticle
Deprecated.- Specified by:
getParticlein interfaceShape
-
getSecondaryParticle
Deprecated.- 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
Deprecated.- Specified by:
getDelayin interfaceShape- Returns:
- amount of ticks between
ParticleShaper.display()being called
-
getSecondaryParticleAmount
Deprecated.- Specified by:
getSecondaryParticleAmountin interfaceShape- Returns:
- the amount of extra particles that this shape uses
- See Also:
-
getMechanicAmount
Deprecated.- 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
Deprecated. -
isRunning
public boolean isRunning() -
recalculateIfNeeded
protected boolean recalculateIfNeeded(@Nullable org.bukkit.Location around) - Overrides:
recalculateIfNeededin classRotationHandler
-
addShape
Adds the given shape to this ParticleShapeCompound under the given name, so that you can easily access the shape viagetShape(String)- Parameters:
shape- shape to addname- name of shape
-
addShape
-
removeShape
Removes the shape with the given name from this ParticleShapeCompound. will do nothing if there are no shapes with the given name- Parameters:
name- name of the shape to remove
-
removeShape
public void removeShape(int index) -
getShape
- Parameters:
name- name of shape, as added viaaddShape(Shape, String)- Returns:
- the shape with the given name
-
getShape
-
getShapes
-
getShapeAmount
public int getShapeAmount()
-