Solved Problem loading the instance of others plugins

Discussion in 'Plugin Development' started by Creeper96, Jul 21, 2013.

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

    Creeper96

    Hi,
    I'm trying to develope a bukkit plugin that use VanishNoPacket API.
    At the load of the plugin I used this code to initialize VanishNoPacket.

    Code:java
    1. public Invisibile()
    2. {
    3. try {
    4. VanishPlugin vnp = VanishNoPacket.getPlugin();
    5. System.out.println(vnp);
    6. Main.vm = vnp.getManager();
    7. Main.server.getPluginManager().registerEvents(this,Main.plugin);
    8. System.out.println("Compatibile con vanish no Packet");
    9.  
    10.  
    11.  
    12. } catch (VanishNotLoadedException e) {
    13. // TODO Auto-generated catch block
    14. e.printStackTrace();
    15. }
    16. }
    17.  


    But when bukkit server start, the server initialize my plugin before vanish no packet and i receive a severe error.

    I have tryed using this code on the main

    Code:java
    1. new java.util.Timer().schedule(
    2. new java.util.TimerTask() {
    3. @Override
    4. public void run() {
    5. // your code here
    6. new Invisibile();
    7. }
    8. },
    9. 12000
    10. );


    and it works fine, but the problem is when 12seconds aren't enough to load all the plugin.
    Who can help me?

    Thanks
     
  2. Offline

    chasechocolate

    Creeper96 make it longer than 12 seconds? ._.
     
  3. Offline

    Creeper96

    chasechocolate :'(

    I'd like to enable the plugin when all other plugin are activated, i cannot wait 1 minutes
     
  4. Offline

    savagesun

    Make the plugin dependent on VanishNoPacket so it gets initialized after it?
    In the plugin.yml:
    Code:
    depend: [VanishNoPacket]
     
    Creeper96 likes this.
  5. Offline

    Creeper96

Thread Status:
Not open for further replies.

Share This Page