Class ParticleManager

java.lang.Object
dev.esophose.playerparticles.manager.Manager
dev.esophose.playerparticles.manager.ParticleManager
All Implemented Interfaces:
java.lang.Runnable, org.bukkit.event.Listener

public class ParticleManager
extends Manager
implements org.bukkit.event.Listener, java.lang.Runnable
  • Field Summary

    Fields inherited from class dev.esophose.playerparticles.manager.Manager

    playerParticles
  • Constructor Summary

    Constructors 
    Constructor Description
    ParticleManager​(PlayerParticles playerParticles)  
  • Method Summary

    Modifier and Type Method Description
    void addPPlayer​(PPlayer pplayer)
    Adds a PPlayer to the loaded map
    void disable()
    Cleans up the Manager's resources
    void displayParticles​(PPlayer pplayer, org.bukkit.World world, ParticlePair particle, java.util.List<PParticle> particles, boolean isLongRange)
    An alternative method used for event styles
    void displayParticles​(PPlayer pplayer, org.bukkit.World world, ParticlePair particle, java.util.List<PParticle> particles, boolean isLongRange, boolean ignorePlayerState)
    An alternative method used for event styles
    java.util.Map<java.util.UUID,​PPlayer> getPPlayers()
    Gets the PPlayers that are loaded
    NoteColor getRainbowNoteParticleColor()
    Gets the rainbow NoteColor for particle spawning with data 'rainbow'
    OrdinaryColor getRainbowParticleColor()
    Gets the rainbow OrdinaryColor for particle spawning with data 'rainbow'
    NoteColor getRandomNoteParticleColor()
    Gets a randomized NoteColor for particle spawning with data 'random'
    OrdinaryColor getRandomParticleColor()
    Gets a randomized OrdinaryColor for particle spawning with data 'random'
    OrdinaryColor getShiftedRainbowParticleColor()
    Gets the rainbow OrdinaryColor for particle spawning with data 'rainbow', shifted half way through the HSB spectrum
    void onPlayerJoin​(org.bukkit.event.player.PlayerJoinEvent e)
    Adds the player to the array when they join
    void onPlayerQuit​(org.bukkit.event.player.PlayerQuitEvent e)
    Removes the player from the array when they log off
    void reload()
    Reloads the Manager's settings
    void run()
    The main loop to display all the particles Does not display particles if the world is disabled or if the player is in spectator mode

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • reload

      public void reload()
      Description copied from class: Manager
      Reloads the Manager's settings
      Specified by:
      reload in class Manager
    • disable

      public void disable()
      Description copied from class: Manager
      Cleans up the Manager's resources
      Specified by:
      disable in class Manager
    • onPlayerJoin

      public void onPlayerJoin​(org.bukkit.event.player.PlayerJoinEvent e)
      Adds the player to the array when they join
      Parameters:
      e - The event
    • onPlayerQuit

      public void onPlayerQuit​(org.bukkit.event.player.PlayerQuitEvent e)
      Removes the player from the array when they log off
      Parameters:
      e - The event
    • getPPlayers

      public java.util.Map<java.util.UUID,​PPlayer> getPPlayers()
      Gets the PPlayers that are loaded
      Returns:
      The loaded PPlayers
    • addPPlayer

      public void addPPlayer​(PPlayer pplayer)
      Adds a PPlayer to the loaded map
      Parameters:
      pplayer - The PPlayer to add
    • run

      public void run()
      The main loop to display all the particles Does not display particles if the world is disabled or if the player is in spectator mode
      Specified by:
      run in interface java.lang.Runnable
    • displayParticles

      public void displayParticles​(PPlayer pplayer, org.bukkit.World world, ParticlePair particle, java.util.List<PParticle> particles, boolean isLongRange)
      An alternative method used for event styles
      Parameters:
      pplayer - The PPlayer the particles are spawning from, nullable for special cases
      world - The world the particles are spawning in
      particle - The ParticlePair to use for getting particle settings
      particles - The particles to display
      isLongRange - If the particle can be viewed from long range
    • displayParticles

      public void displayParticles​(PPlayer pplayer, org.bukkit.World world, ParticlePair particle, java.util.List<PParticle> particles, boolean isLongRange, boolean ignorePlayerState)
      An alternative method used for event styles
      Parameters:
      pplayer - The PPlayer the particles are spawning from, nullable for special cases
      world - The world the particles are spawning in
      particle - The ParticlePair to use for getting particle settings
      particles - The particles to display
      isLongRange - If the particle can be viewed from long range
      ignorePlayerState - If the player's visibility state should be ignored
    • getRainbowParticleColor

      public OrdinaryColor getRainbowParticleColor()
      Gets the rainbow OrdinaryColor for particle spawning with data 'rainbow'
      Returns:
      The rainbow OrdinaryColor for particle spawning with data 'rainbow'
    • getShiftedRainbowParticleColor

      public OrdinaryColor getShiftedRainbowParticleColor()
      Gets the rainbow OrdinaryColor for particle spawning with data 'rainbow', shifted half way through the HSB spectrum
      Returns:
      The rainbow OrdinaryColor for particle spawning with data 'rainbow', shifted half way through the HSB spectrum
    • getRainbowNoteParticleColor

      public NoteColor getRainbowNoteParticleColor()
      Gets the rainbow NoteColor for particle spawning with data 'rainbow'
      Returns:
      The rainbow NoteColor for particle spawning with data 'rainbow'
    • getRandomParticleColor

      public OrdinaryColor getRandomParticleColor()
      Gets a randomized OrdinaryColor for particle spawning with data 'random'
      Returns:
      A randomized OrdinaryColor for particle spawning with data 'random'
    • getRandomNoteParticleColor

      public NoteColor getRandomNoteParticleColor()
      Gets a randomized NoteColor for particle spawning with data 'random'
      Returns:
      A randomized NoteColor for particle spawning with data 'random'