2 Versions of plugin in one JAR

Discussion in 'Spigot Plugin Development' started by snadol, Oct 14, 2018.

  1. Is there a way to have a 1.13 and a <1.13 version of my plugin in one jar file and have the 1.13 one activated if on 1.13 and if not then have the <1.13 one activated?
  2. It's clean, rather than having 2 different jar files, and makes my IDE more organized. Can you get me started on how to do that (not asking for spoonfeed)?
  3. I've looked that up and I'm completely lost.
  4. Maven or Gradle Modules i think is possible with ant too, not sure :B
  5. Use Maven and add at dependencies 1.13.1 version. It will be work. But if you use NMS, I think you can’t
  6. It is technically possible but not feasible. Your plugin.yml is basically just a file sitting on the upper most level from your jar. Since you have to declare that you are using the 1.13 api there you need two versions of the file. Aka you have to change the file structure of your jar on the fly. This is not possible from inside your Main class because the plugin.yml always gets loaded first. So you would have to create a wrapper for spigot or maybe a custom start script with some tinkering to change your plugin.jar before spigot/Bukkit launches.
    It is easier for everyone involved to keep 2 separate jars for both api versions.

Share This Page