Load plugin last

Discussion in 'Plugin Development' started by hammale, Feb 13, 2012.

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

    hammale

    hullo all. is there a way to force a plugin to load last? it looks like theres:
    • STARTUP
    • POSTWORLD
    but is there a LAST? i guess i could just add a timer but thats not a very clean way to do it...thx in advanced!
     
  2. Offline

    Stone_Tigris

    hammale
    Not that I know of, my server seems to do it in size order. I just leave mine as postworld, why do you need a plugin to load last by the way?
     
  3. Offline

    hammale

    hmmm well im writing a plugin that hooks into citizens and when the plugin enables i want to do somthing with them. in my onEnable i call this method:
    Code:text
    1.  
    2. public void fixNpc(){
    3. for (World world : getServer().getWorlds()) {
    4. for(Entity e : world.getEntities()){
    5. if(CitizensManager.isNPC(e)){
    6. System.out.println("debug");
    7. }
    8. }
    9. }
    10. }
    11.  

    but its never printing debug :( i think the reason is that this:
    Code:
    [INFO] Fetching addPacket for removed entity: CraftPlayer{name=test}
    is displayed long after my plugin enables...

    im going to try delaying the method w/ a delayed task...lets see if that even wrks :)

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

    Stone_Tigris

    hammale I'm afraid I can't help you there. I had a look in the API and nothing seemed to stand out. Not experienced enough to know if this is even possible.

    EDIT: Just saw what you posted and it's worth a try.
     
  5. Offline

    hammale

    hmmm delaying it for 5 seconds seems to have fixed it...
     
  6. Offline

    coldandtired

    One of the staff posted somewhere that if you set a one tick delayed timer it will run after all the plugins have loaded.
     
    FroznMine and hammale like this.
  7. Offline

    hammale

    ill test this later thx :)
     
  8. Offline

    greatman

    Softdepend (or depend) in the plugin.yml will make your plugin load after the one you added.
     
  9. hammale

    Yes that's correct. Whatever code you want to run after all plugins have loaded just schedule a task using Bukkits scheduler.
     
Thread Status:
Not open for further replies.

Share This Page