Stop loading plugin

Discussion in 'Plugin Development' started by farget92, Oct 25, 2014.

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

    farget92

    Hello everyone,

    I am sometimes trying develop plugin for Bukkit, but now I find one problem and I don't know nothing to solved it.
    Please can you help me??

    I want to stop loading plugin when is some condition is true...
    Like:
    Code:
            if(LoadConfig.loadData() == false){
               
                Bukkit.getConsoleSender().sendMessage(chat + "World: " + ChatColor.WHITE + LoadConfig.getString("world") + " doesn't exist!!");
                //HERE
            }
    And then when is typed HERE, I want to stop loading plugin and disabled it.
    Can you help me with this problem ??
    Thank for every response :)
     
  2. Offline

    fireblast709

  3. Offline

    Googlelover1234

    So like

    Code:java
    1. Bukkit.getPluginManager.disablePlugin(this);

    ?
     
  4. Offline

    TheCodingCat

    why would you want to disable a plugin farget92 ?
     
  5. Offline

    Gerov

    TheCodingCat I maybe checking for dependencies above the code he gave us :p.
     
  6. Offline

    TheCodingCat

    why dont you just use the plugin.yml dependencies. Its a lot more efficent. And there is also soft depend just incase their is a feature that requires a plugin
     
  7. Offline

    farget92

    I understand your question: Why ?
    Reason is: That I check in method if the world with name from config exist and if it not, I don't try use any , I
    Exception don't like them. I want to stop load plugin if the world [name] does not exist.
    I think that is better than try some exception or finally or something like that.
    If someone of you have better solution please advice me:)

    And sorry for my English, it isn't good .)
     
Thread Status:
Not open for further replies.

Share This Page