Cant load a plugin after another

Discussion in 'Plugin Development' started by Pik0, Dec 30, 2014.

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

    Pik0

    Hello guys, I need help. I have an API, and I have a plugin using that API. Well, every single time the server starts, the API loads after the plugin, so the plugin crashes and dont work.

    Yes, i am using "softdepend: [API]" in the plugin's plugin.yml and the API name is really "API"

    I cant start the server with this, and I need help
     
  2. @Pik0 Try putting depend: [API], maybe that forces your plugin to load before the API.
     
  3. Offline

    Pik0

    @Lionhard Same error, tried that too and "loadbefore" too
     
  4. @Pik0 loadbefore would say that your plugin HAS to load before the other ones. And after checking the reference, there is no similar command for doing the opposite. I don't have anymore ideas. :/
     
  5. Offline

    CubieX

    Normally the "depened" statement should do the trick.
    Doublecheck the name of your API in the plugin.yml of the API plugin.

    If it really does not work, then I would suggest to start a task timer in the onEnable of your plugin
    that checks every second if the API is available (null != apiInstance)
    and executes the plugin configuration as soon as the API is available.
    You can abort this task timer and fail the load of the plugin after a grace period of 60 seconds or so. (set this depending on how fast your server usually starts).
    Until the instance of the API is successfully retrieved, you do not use any API functions and basicly "idle" your plugin.
     
Thread Status:
Not open for further replies.

Share This Page