Solved All plugins enabled

Discussion in 'Plugin Development' started by raGan., Jan 19, 2013.

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

    raGan.

    I need to run certain things once all plugins have been enabled, but I am not sure how to do that. I know about PluginEnableEvent, but I think that's not what I'm looking for. What I basically need to achieve is to run something after onEnable() of all plugins have been run. Anyone any ideas ?

    I just found solution. (been too hasty posting here again)
    For those who are curious, here it is.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 30, 2016
  2. Offline

    Adamki11s

    raGan.
    What are you trying to do?

    You could setup a scheduler task and inside it check if all plugins are loaded and then if they are run your code and cancel the task.
     
  3. Offline

    raGan.

    I believe all scheduled tasks are run after server was started (in other words all plugins enabled), so setting it to 1 tick should be just fine. Also it appears to work for Citizens.

    Edit: Oh, I'm trying to provide some kind of API for plugins to hook into, and I need to run certain things after they register their classes.
     
  4. Offline

    sionzee

  5. Offline

    raGan.

  6. Offline

    Adamki11s

    raGan.
    An alternative solution if you get plugins which will use your API to add a depend tag in their plugin.yml as so

    Code:
    Depend:Plugin name
    Then it will make sure that your plugin loads before theirs.
     
  7. Offline

    raGan.

    And that's exactly why I need this. They need to depend me and load after me, but I need certain things after their plugins are loaded.
     
  8. Offline

    Adamki11s

    raGan.
    Ah okay, I understand.
     
  9. Offline

    Panjab

    Code:
    if (getServer().getPluginManager().isEnabled(String plugin) { }
     
  10. Offline

    raGan.

    Noticed that "Solved" mark ? Also make sure you read what OP wants next time.
     
Thread Status:
Not open for further replies.

Share This Page