Solved ScheduledDelayedTask needs his own id! How to do that?

Discussion in 'Plugin Development' started by InflamedSebi, Apr 14, 2013.

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

    InflamedSebi

    Code:java
    1. int taskID = plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() {
    2.  
    3. @Override
    4. public void run() {
    5. player.teleport(location);
    6. player.sendMessage(plugin.config.getString("Messages.done"));
    7. plugin.teleporting.remove(taskID);
    8.  
    9. }
    10.  
    11. }, plugin.config.getInt("delay"));


    hay. the task needs to remove its id from a map, if it was executed. but i can't change the taskID to final ...

    is there a way to get the own task id?
     
  2. Offline

    techboy291

    Why can't you make the task ID a final?
     
Thread Status:
Not open for further replies.

Share This Page