Arraylist Help

Discussion in 'Plugin Development' started by Flyingbadger135, Jul 19, 2013.

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

    Flyingbadger135

    I just made a simple kit plugin with cooldowns however everytime a player relogs, he can use the kit again. What am I doing wrong in the arraylist or the scheduled delay task?
    Code:
    Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(this, new Runnable(){
     
                @Override
                public void run() {
                    cooldown.remove(player);
             
                 
                }
               
              }, 864000);
     
  2. Offline

    savagesun

    You should not be storing the actual player.. This is a perfect situation to cause memory leaks. You should be storing their name instead, it should fix your relogging issue.
     
  3. Offline

    tills13

    Player objects are unique per session/server/etc. player.getName() is a safe way to go.
     
  4. Offline

    Flyingbadger135

    Thank you helped a lot!
     
Thread Status:
Not open for further replies.

Share This Page