load-before

Discussion in 'Bukkit Preview' started by Wolvereness, Mar 20, 2012.

  1. Offline

    Wolvereness Bukkit Team Member

    There is now a configuration option in the plugin.yml that allows you to specify plugins that you wish your plugin to load before. This is treated like a soft-dependency from the specified plugin, just as if that plugin added "softdepend: [ MyPlugin ]". The node is "loadbefore", and defined the same way depend and softdepend are defined.

    Common question: What happens in circular load-before?
    Common question: What happens in circular soft-dependency?
    Answer: When the loader no longer has any plugins without a remaining dependency, it will randomly (based on hash code) select a plugin without a hard dependency and load it, restarting the search.

    Common question: What happens with a load before and soft dependency on the same plugin?
    Answer: Load before is treated the same as a soft-dependency. So, both plugins would effectively soft-depend each other, see above question.

    Common question: What happens if two plugins explicitly depend each other?
    Answer: They both fail. Software should either be combined, or separated with a common API.

    Common question: What happens if you softdepend a plugin that depend on you?
    Answer: Similar to a circular soft-dependency. When the loader no longer has any plugins without a remaining dependency, it will randomly (based on hash code) select a plugin without a hard dependency and load it, restarting the search. In this case, the plugin with the hard depend will not load arbitrarily until after its dependency has loaded.

    Common question: How does the depend / softdepend / loadbefore system decide what loads first?
    Answer: It uses a best effort basis with a temporary store of the dependencies and soft dependencies, removing items from the list using emptiness as a determination for loading. Easy explanation is that it is set up to never ignore soft dependencies unless absolutely needed to continue loading.
     
    Skyost likes this.

Share This Page