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 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 addition
      y - y addition
      z - 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 scale
      y - y scale
      z - 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

      void addParticle(Particle particle, int particlesUntilDisplay)
      adds a particle for this shape to display after a certain amount of other particles
      Parameters:
      particle - particle to add
      particlesUntilDisplay - how many particles need to be displayed before this one
    • addMechanic

      void addMechanic(ShapeDisplayMechanic.Phase phase, ShapeDisplayMechanic mechanic)
      Similar to Consumer
      in the case of phases ShapeDisplayMechanic.Phase.BEFORE_ROTATION and ShapeDisplayMechanic.Phase.AFTER_ROTATION the 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 at
      mechanic - 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

      void addPlayer(UUID uuid)
      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

      void setParticle(Particle particle)
    • setParticleFrequency

      void setParticleFrequency(int particleFrequency)
      Parameters:
      particleFrequency - amount of times to display the particle per full animation
    • setParticlesPerDisplay

      Shape setParticlesPerDisplay(int particlesPerDisplay)
      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

      Shape setAsync(boolean async)
    • setDelay

      Shape setDelay(int delay)
      Parameters:
      delay - amount of ticks between display() 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

      void setRotationOrder(Rotation.Axis first, Rotation.Axis second, Rotation.Axis third)
    • 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

      Pair<Particle,Integer> getSecondaryParticle(int index)
      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

      List<UUID> 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()