Private Scheduler's

Discussion in 'Plugin Development' started by quinster08, Dec 18, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    quinster08

    Hello guys,

    I have made a particle plugin. When a player enables a particle it cancels all running schedulers. So if 2 players are using particle's and one player chooses another particle the particle of the other guy gets also canceled. How can I make a private scheduler for each person?
     
  2. Offline

    uksspy

    Create a new object of the scheduler method. Just make sure to cancel them if a player removes the particles to prevent tons of useless schedulers.
     
  3. Offline

    timtower Administrator Administrator Moderator

    @quinster08 1 runnable with a hashmap of players. Then act based on the values in the hashmap. When a user stops his particle then remove him from the map
     
  4. Offline

    quinster08

  5. Offline

    xTrollxDudex

    Code:
    Player,Effect map
    
    schedule whatever {
        for player : map
            player playEffect(get player in map)
    }
     
    timtower likes this.
  6. Offline

    quinster08

    I don't really get this... What I want is that if a player cancels a particle that it doesn't stop particle's of other players.
     
  7. Offline

    1Rogue

    The whole point of using a Map is to store a reference of which player has which effect to apply. The runnable then gets all the players in the map and plays their respective effect every x ticks. If you don't want a player to have an effect, just remove them from the map.
     
    xTrollxDudex likes this.
Thread Status:
Not open for further replies.

Share This Page