How do I make my plugin load last of all?

Discussion in 'Plugin Development' started by EdenCampo, Oct 26, 2011.

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

    EdenCampo

    -snip-

    Thanks!
     
  2. Offline

    Father Of Time

    Give it a wedgy and tell all the other plug-ins it has kooties... If I remember elementary school correctly that works pretty well... All seriousness though I don't know, some reason this just popped in my head and I found it funny. :D
     
  3. Offline

    EdenCampo

    -.-.

    Someone can REALLY help?
     
  4. Offline

    Father Of Time

    Well you're a kill joy... *runs off*
     
  5. Offline

    ArcheCane

    This sub-forum is for people who need help and want people who actually answer.
     
    Aengo likes this.
  6. Offline

    ItsHarry

    Eh.. I think you would have to use the Bukkit scheduler to delay the event
     
  7. Offline

    Tux2

    You shouldn't need to have your plugin load last of all to accomplish that. What you need is a listener that listens to when a world is loaded because with MultiVerse you can create worlds while the server is running. A good thing to do is look at a good solid plugin that already does that, like my plugin WeatherRestrictions.
    If you look on the onEnable() function in src/tux2/weatherrestrictions/WeatherRestrictions.java starting at line 67 you will see the proper way of adding the listener. The listener file itself is called WeatherRestrictionsWorldListener.java. Hopefully this helps you out.
     
  8. Offline

    Windwaker

    If you need to have your plugin load after a certain plugin for dependency issues add:
    Code:
    depend: [PluginThatLoadsFirst]
    To your plugin.yml
     
  9. Offline

    Afforess

    Okay, first off, you should rethink your design. There is a world load event you can listen to.

    BUT, if you want to keep your (poor) design, you can use a trick to make it load last. Add

    softdepend: zzzzzzz

    To your plugin.yml. Softdepends make your plugin load after other plugins, but only if they exist. This means the first time Bukkit tries to load your plugin, it will fail since zzzzzzz is clearly not a real plugin. The second time Bukkit tries to load your plugin is after the first pass, where 90% of plugins have loaded. Don't take my word for it, try it.
     
    Tux2 likes this.
Thread Status:
Not open for further replies.

Share This Page