1.8.8 The API and my plugin in plugins folder

Discussion in 'Spigot Plugin Development' started by Ecofg, Feb 16, 2020.

  1. I am using spigot 1.8 because I want to create a minigame server for players from version 1.8 to 1.15.

    But after I compiled my plugin in IntelliJ IDEA, I put it in the plugins folder, but it didn't seem to work. I thought that maybe the plugin I just compiled didn't include the API I was using for the plugin, so I put the API .JAR file in the same plugins folder and now it works.

    My question is, how can I include the API and the plugin I am creating in the same JAR file so that I don't have to have two files (1st being the API, 2nd being the actual plugin) in the plugins folder?

    If this helps, there seem to be an warning while compiling the plugin:
    "'dependencies.dependency.systemPath' for me.illuminatiproductions.actionbarapi:actionbarapi:jar should use a variable instead of a hard-coded path C:/Users/Hubertas/Desktop/Backup_folder/minecraft/minecraft API's/Spigot/ActionBarAPI-1.5.4.jar @ line 31, column 25"
     
  2. To include ActionBarAPI (which is inactive and doesn't appear to support 1.15) in your plugin using Maven, you would need to "shade" it in. Here's a tutorial which covers this briefly in several sections: https://www.spigotmc.org/threads/maven-nms-tutorial.347254/

    However, the compiler warning you've shared is just that: a warning. Unlike an error, a warning won't stop the plugin from working. You're using a jar file as a dependency, which is not recommended because a major benefit of using Maven is so that the project can pull its dependencies from the Internet via repositories. ActionBarAPI doesn't seem to have an official repository, so you'd have to use something like Jitpack.

    If you have trouble understanding any of this, consider simply not using Maven. Unless this is something that requires NMS or you intend to share it on a site like Github, you'll probably be fine with a basic Java project.
     
  3. Well, another problem arises, now I've added the code that jitpack gave me after I entered the repository link here, but now the plugin isn't even being loaded (also, another person explained me, that the repository doesn't have versions and said that I should replace this: "<version>1.5.4</version>" with this: "<version>5b2d642d3df240cfd2545effcdcacec38405f9cf</version>" instead; This seamed to fix the problem in the compiler at IntelliJ IDEA)

    Now the error occurs while starting the spigot server with this plugin:

    Code (Text):
    Could not load 'plugins\DeathSwap-1.0-SNAPSHOT.jar' in folder 'plugins'
    org.bukkit.plugin.UnknownDependencyException: ActionBarAPI
            at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:219) [spigot.jar:git-Spigot-c3c767f-33d5de3]
            at org.bukkit.craftbukkit.v1_8_R1.CraftServer.loadPlugins(CraftServer.java:291) [spigot.jar:git-Spigot-c3c767f-33d5de3]
            at net.minecraft.server.v1_8_R1.DedicatedServer.init(DedicatedServer.java:152) [spigot.jar:git-Spigot-c3c767f-33d5de3]
            at net.minecraft.server.v1_8_R1.MinecraftServer.run(MinecraftServer.java:505) [spigot.jar:git-Spigot-c3c767f-33d5de3]
            at java.lang.Thread.run(Unknown Source) [?:1.8.0_241]
     
  4. Remove ActionBarAPI from your plugin.yml
     
    • Agree Agree x 1