Calling an event after all plugins are loaded?

Discussion in 'Plugin Development' started by Prgr, Jun 8, 2013.

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

    Prgr

    When my plugin starts up it loads LandPlots from a file and calls an event for each loaded. My second plugin depends on LandPlots and also needs to "hear" those LandPlotRegisterEvent calls. Any ideas?
     
  2. Offline

    Rockon999

    Add depend:[Plugin1Name] to Plugin2's plugin.yml

    And you can listen for your plugin's events by adding your plugin to Plugin2's Referenced Libraries :)

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 1, 2016
  3. Offline

    Prgr

    I prefer Plugin1 to be independent
    I have done that

    Rockon999 I see you have developed a land claiming plugin :) Would you like to see what I am working on via Hamachi?

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

    Rockon999

    Prgr
    Don't want to sound mean, but no thank you :p
    I'm really busy right now :)

    Adding the depend will just cause Plugin1 to load before Plugin2, thus allowing Plugin2 to not give errrors & function properly :) ... you said it yourself the Plugin2 depends on Plugin1...

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 1, 2016
  5. Offline

    Prgr

    Yes. if Plugin1 callsEvents in the onEnable (for Plugin1) then Plugin2 will not catch them because Plugin2 waits for Plugin1 to be enabled. I am going to do a sloppy joe on this with onPlayerJoinEvent and a boolean -- don't spit on me :p
     
  6. Offline

    Rockon999

    ah.. I get it now... derp :p
    p.s. (I won't spit on you)
     
  7. Offline

    Technius

    Prgr
    You could schedule the event calling code so that it executes after all the plugins are enabled. You could also listen to a PluginEnableEvent.
     
  8. Offline

    Ultimate_n00b

    Just make a delayed task in your onEnable, that runs after a tick.
     
Thread Status:
Not open for further replies.

Share This Page