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

Generic Java library support for plugins

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • None
    • Windows 10

      Processor: Intel(R) Core(TM) i5-8500 CPU @ 3.00GHz 3.00 GHz

      Installed memory: 8.00 GB (7.80 GB usable)

      System Type: 64-bit Operating System, x64-based processor

    • git-Spigot-94af569-a3fdef8 (MC: 1.14.4) (Implementing API version 1.14.4-R0.1-SNAPSHOT)
    • Yes

      Although this isn't necessarily an issue, and the same goal can easily be achieved with various other methods, my suggestion is to have a "libraries" folder where jar libraries can be placed in order for other plugins to use.

      A few non-limiting possibilities regarding the programmatic name of the library:

      1. The file name can be the name of the library
      2. The library jar will need a resource called "name.txt"

       

      Library names can be listed in the "depend" or "softdepend" part of the plugin.yml of other plugins.

      During runtime, a plugin can also maybe do something like this:

      //
      PluginManager plugman = myPlugin.getServer().getPluginManager();
      if (plugman.isLibraryEnabled("MyLibrary")) {...}

      or whatever is best.

       

      Libraries won't necessarily need to be 'enabled', just their URLs loaded into the necessary classloaders.

       

      Again, this obviously isn't an absolute necessity. It's also (most likely) not even a good idea because I'm sure there is some complicated unforeseen mechanic of spigot waiting to annihilate me with fax and logic 

       

      PS: I also tried using --rev latest and the server still says I'm 4 versions behind so sorry if that is not the latest one

      PS (AGAIN): Never-mind, I forgot to drag in the compiled jar into my server's directory like a dolt

            Unassigned Unassigned
            Perzan Perzan
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: