Solved Can't Re-Enable Plugin

Discussion in 'Plugin Development' started by oriamrm, Aug 30, 2017.

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

    oriamrm

    Waddduuup??!
    So I made a plugin (We'll call it plugin 1) disable itself automatically once it is enabled, until another plugin (We'll call it plugin 2) I created re-enables it, but for some reason, it can't. I checked by using /pl and it says plugin 1 exists and it is disabled. I even added a debug statement. Here's the code:

    Code:
    Bukkit.broadcastMessage(String.valueOf(Bukkit.getPluginManager().isPluginEnabled(args[0])));
    Bukkit.getPluginManager().enablePlugin(Bukkit.getPluginManager().getPlugin(args[0]));
    Bukkit.broadcastMessage(String.valueOf(Bukkit.getPluginManager().isPluginEnabled(args[0])));
            
    
    (args[0] is plugin 1's name, and yes, I made sure it is the correct name)

    And it just broadcasts:
    false
    false

    Is there a method I should also execute or something? What aren't I doing right?
     
  2. Offline

    timtower Administrator Administrator Moderator

    @oriamrm
    Bukkit.getPluginManager().getPlugin(args[0])
    What does that return?
     
  3. Offline

    oriamrm

    I'm so stupid, just got what I was doing wrong. Sorry for wasting your time, this was so stupid...
    :(
     
  4. Offline

    timtower Administrator Administrator Moderator

    @oriamrm Could you share what you was doing wrong?
     
  5. Offline

    oriamrm

    @timtower
    I read again what I wrote, and noticed that I AM DISABLING THE PLUGIN WHEN IT ENABLES <Face Palm>.
     
    timtower likes this.
Thread Status:
Not open for further replies.

Share This Page