Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-5060

getPlugin not recognizing some plugins

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Invalid
    • Icon: Minor Minor
    • None
    • None
    • CraftBukkit version git-Spigot-df0eb25-411609d (MC: 1.14.2) (Implementing API version 1.14.2-R0.1-SNAPSHOT)
    • My test plugin (recipeTest), Vault, PermissionsEX
    • Yes

      I noticed that some plugins are not being recognized by `getPlugin` one in particular was PEX.

      This was brought to my attention when someone mentioned one of my plugins (which has a dependancy for PEX) was not loading properly. 

      I created a test plugin and had it check both Vault and PEX, vault is caught fine where as PEX is not. 

      The code I used for testing:

      @Override
      public void onEnable() {
          if (Bukkit.getPluginManager().getPlugin("PermissionsEX") != null) {
              Bukkit.getConsoleSender().sendMessage(ChatColor.GREEN + "PEX FOUND");
          } else {
              Bukkit.getConsoleSender().sendMessage(ChatColor.RED + "NO PEX");
          }
          if (Bukkit.getPluginManager().getPlugin("Vault") != null) {
              Bukkit.getConsoleSender().sendMessage(ChatColor.GREEN + "VAULT FOUND");
          } else {
              Bukkit.getConsoleSender().sendMessage(ChatColor.RED + "NO VAULT");
          }
      
          for (Plugin plugin : Bukkit.getPluginManager().getPlugins()) {
              Bukkit.getConsoleSender().sendMessage(ChatColor.GREEN + plugin.getName());
          }
      
      }
      

      The output (Which shows both PEX and Vault have loaded successfully) I also added a little message showing which plugins were loaded

      [17:18:22] [Server thread/INFO]: [PermissionsEx] Enabling PermissionsEx v1.23.4
      [17:18:22] [Server thread/INFO]: [PermissionsEx] Initializing file backend
      [17:18:22] [Server thread/INFO]: [PermissionsEx] Permissions file successfully reloaded
      [17:18:22] [Server thread/INFO]: [Vault][Permission] PermissionsEx hooked.
      [17:18:22] [Server thread/INFO]: [Vault] [Vault][Chat] PermissionsEx_Chat hooked.
      [17:18:22] [Server thread/INFO]: [RecipeTest] Enabling RecipeTest v1.0.0
      [17:18:22] [Server thread/INFO]: NO PEX
      [17:18:22] [Server thread/INFO]: VAULT FOUND
      [17:18:22] [Server thread/INFO]: PermissionsEx
      [17:18:22] [Server thread/INFO]: Vault
      [17:18:22] [Server thread/INFO]: RecipeTest
      

      This issue did not happen on 1.13.2, I know for a fact my plugin worked with no issues on past Spigot versions.

      I have tested this on Craftbukkit, and it has the exact same outcome.

       

      I included my test jar for testing (ignore the name, its the same test plugin I use for all my reports)

            Unassigned Unassigned
            ShaneBee Shane Bee
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: