Interface Shape
- All Known Implementing Classes:
ParticleCircle,ParticleCircleFilled,ParticleCylinder,ParticleFluid,ParticleImage,ParticleLine,ParticleLineCurved,ParticlePolygon,ParticlePolygonFilled,ParticleShapeCompound,ParticleShaper,ParticleSphere,ParticleSphereCSA,ParticleSpiral,ParticleText
public interface Shape
-
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 emptyclone()voiddisplay()voidface(org.bukkit.Location toFace) voidfaceAroundLocation(org.bukkit.Location toFace, org.bukkit.Location around) doubledoubledoubledoubledoubledoubledoubledoubledoubleorg.bukkit.LocationintgetDelay()intorg.bukkit.Location[]intintintdoublegetPitch()intdoublegetRoll()getSecondaryParticle(int index) intdoubleorg.bukkit.WorldgetWorld()doublegetYaw()booleanhasPlayer(org.bukkit.entity.Player player) booleanisAsync()booleanvoidmove(double x, double y, double z) adds the given x, y, z values to every location in the shapevoidmove(org.bukkit.Location location) adds the given location to every location in the shapevoidmove(org.bukkit.util.Vector vector) adds the given vector to every location in the shapevoidremoveMechanic(int index) voidremoveParticle(int index) voidremovePlayer(int index) voidremovePlayer(org.bukkit.entity.Player player) voidrotate(double pitch, double yaw, double roll) voidrotateAroundLocation(org.bukkit.Location around, double pitch, double yaw, double roll) voidscale(double scale) Rescales this shape such that a shape with the xyz radiuses of 4, 3, 4, resized by 1.25, would have its radiuses become 5, 3.75, 5.voidscale(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.voidsetAroundAxisPitch(org.bukkit.Location around, double pitch) voidsetAroundAxisRoll(org.bukkit.Location around, double roll) voidsetAroundAxisRotation(org.bukkit.Location around, double pitch, double yaw, double roll) voidsetAroundAxisYaw(org.bukkit.Location around, double yaw) voidsetAroundPitch(org.bukkit.Location around, double pitch) voidsetAroundRoll(org.bukkit.Location around, double roll) voidsetAroundRotation(org.bukkit.Location around, double pitch, double yaw, double roll) voidsetAroundRotationOrder(org.bukkit.Location around, Rotation.Axis first, Rotation.Axis second, Rotation.Axis third) voidsetAroundYaw(org.bukkit.Location around, double yaw) setAsync(boolean async) voidsetAxisPitch(double pitch) voidsetAxisRoll(double roll) voidsetAxisRotation(double pitch, double yaw, double roll) voidsetAxisYaw(double yaw) 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 calledvoidsetPitch(double pitch) voidsetRoll(double roll) voidsetRotation(double pitch, double yaw, double roll) voidsetRotationOrder(Rotation.Axis first, Rotation.Axis second, Rotation.Axis third) voidsetWorld(org.bukkit.World world) voidsetYaw(double yaw) start()stop()
-
Method Details
-
start
Shape start()- Returns:
- this object
-
stop
Shape stop()- Returns:
- this object
-
clone
Shape clone() -
display
void display() -
rotate
void rotate(double pitch, double yaw, double roll) -
rotateAroundLocation
void rotateAroundLocation(org.bukkit.Location around, double pitch, double yaw, double roll) -
face
void face(org.bukkit.Location toFace) -
faceAroundLocation
void faceAroundLocation(org.bukkit.Location toFace, org.bukkit.Location around) -
move
void move(double x, double y, double z) adds the given x, y, z values to every location in the shape- Parameters:
x- x additiony- y additionz- z addition
-
move
void move(org.bukkit.util.Vector vector) adds the given vector to every location in the shape- Parameters:
vector- vector to add
-
move
void move(org.bukkit.Location location) adds the given location to every location in the shape- Parameters:
location- location to add
-
scale
void scale(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.- Parameters:
x- x scaley- y scalez- z scale
-
scale
void scale(double scale) Rescales this shape such that a shape with the xyz radiuses of 4, 3, 4, resized by 1.25, would have its radiuses become 5, 3.75, 5.- Parameters:
scale- scale amount
-
addParticle
adds a particle for this shape to display after a certain amount of other particles- Parameters:
particle- particle to addparticlesUntilDisplay- how many particles need to be displayed before this one
-
addMechanic
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)- Parameters:
phase- phase that the mechanic should run atmechanic- mechanic to run during display
-
addPlayer
void addPlayer(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 empty- Parameters:
player- player to add
-
addPlayer
adds a player for this shape to display to, defaults to all online players in the shape's world if the list is empty- Parameters:
uuid- ID of player to add
-
removeParticle
void removeParticle(int index) - Parameters:
index- index of particle in list (main particle is not in list)- See Also:
-
removeMechanic
void removeMechanic(int index) - Parameters:
index- index of mechanic in list- See Also:
-
removePlayer
void removePlayer(int index) - Parameters:
index- index of player to remove from list- See Also:
-
removePlayer
void removePlayer(org.bukkit.entity.Player player) - Parameters:
player- player to remove from list- See Also:
-
hasPlayer
boolean hasPlayer(org.bukkit.entity.Player player) - Parameters:
player- player to check for- Returns:
- whether this shape displays to this player
-
setParticle
-
setParticleFrequency
void setParticleFrequency(int particleFrequency) - Parameters:
particleFrequency- amount of times to display the particle per full animation
-
setParticlesPerDisplay
0 means that the entire animation will be played when .display() is called- Parameters:
particlesPerDisplay- amount of particles that will be shown per display
-
setAsync
-
setDelay
- Parameters:
delay- amount of ticks betweendisplay()being called
-
setDisplayPosition
void setDisplayPosition(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)- Parameters:
position- position for shape to display at
-
setWorld
void setWorld(org.bukkit.World world) -
setRotation
void setRotation(double pitch, double yaw, double roll) -
setRotationOrder
-
setPitch
void setPitch(double pitch) -
setYaw
void setYaw(double yaw) -
setRoll
void setRoll(double roll) -
setAroundRotation
void setAroundRotation(org.bukkit.Location around, double pitch, double yaw, double roll) -
setAroundRotationOrder
void setAroundRotationOrder(org.bukkit.Location around, Rotation.Axis first, Rotation.Axis second, Rotation.Axis third) -
setAroundPitch
void setAroundPitch(org.bukkit.Location around, double pitch) -
setAroundYaw
void setAroundYaw(org.bukkit.Location around, double yaw) -
setAroundRoll
void setAroundRoll(org.bukkit.Location around, double roll) -
setAxisRotation
void setAxisRotation(double pitch, double yaw, double roll) -
setAxisPitch
void setAxisPitch(double pitch) -
setAxisYaw
void setAxisYaw(double yaw) -
setAxisRoll
void setAxisRoll(double roll) -
setAroundAxisRotation
void setAroundAxisRotation(org.bukkit.Location around, double pitch, double yaw, double roll) -
setAroundAxisPitch
void setAroundAxisPitch(org.bukkit.Location around, double pitch) -
setAroundAxisYaw
void setAroundAxisYaw(org.bukkit.Location around, double yaw) -
setAroundAxisRoll
void setAroundAxisRoll(org.bukkit.Location around, double roll) -
getWorld
org.bukkit.World getWorld() -
getParticle
Particle getParticle() -
getSecondaryParticle
- 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
int getParticleFrequency() -
getParticlesPerDisplay
int getParticlesPerDisplay()- Returns:
- the amount of particles per display
- See Also:
-
getDelay
int getDelay()- Returns:
- amount of ticks between
ParticleShaper.display()being called
-
getSecondaryParticleAmount
int getSecondaryParticleAmount()- Returns:
- the amount of extra particles that this shape uses
- See Also:
-
getMechanicAmount
int getMechanicAmount()- Returns:
- the amount of mechanics used by this shape
- See Also:
-
getPlayers
- Returns:
- the UUIDs of all the players that this shape displays to. displays to all players if this list is empty
-
getPlayerAmount
int getPlayerAmount()- Returns:
- amount of players this shape displays to
-
getRotationOrder
Rotation.Axis[] getRotationOrder() -
getPitch
double getPitch() -
getYaw
double getYaw() -
getRoll
double getRoll() -
getAroundRotationOrder
Rotation.Axis[] getAroundRotationOrder() -
getAroundPitch
double getAroundPitch() -
getAroundYaw
double getAroundYaw() -
getAroundRoll
double getAroundRoll() -
getAxisPitch
double getAxisPitch() -
getAxisYaw
double getAxisYaw() -
getAxisRoll
double getAxisRoll() -
getAroundAxisPitch
double getAroundAxisPitch() -
getAroundAxisYaw
double getAroundAxisYaw() -
getAroundAxisRoll
double getAroundAxisRoll() -
getLocations
org.bukkit.Location[] getLocations() -
getLocationAmount
int getLocationAmount() -
getTotalDistance
double getTotalDistance()- Returns:
- the distance between every location in this shape
-
getClonedCenter
org.bukkit.Location getClonedCenter()- Returns:
- a new Location object set to the center of this shape
-
isAsync
boolean isAsync() -
isRunning
boolean isRunning()
-