MinecraftDev icon indicating copy to clipboard operation
MinecraftDev copied to clipboard

Add spigot-api dependency when creating a Paper based plugin for MC 1.17+

Open Kamilkime opened this issue 4 years ago • 6 comments

When creating a new Paper project for MC 1.17 or 1.17.1 (so versions using the new Paper artifact maven groups) - no bukkit or spigot API is actually added to a project, I guess it always was a transitive dependency but now isn't (?). For older MC versions - adding just paper-api works fine.

So I'd like to suggest adding also a spigot-api dependency when creating a new Paper project.

Kamilkime avatar Sep 27 '21 06:09 Kamilkime

I don't see any mention of bukkit or spigot-api in https://papermc.io/using-the-api Are you sure these artifacts are needed for a paper plugin ?

RedNesto avatar Sep 27 '21 09:09 RedNesto

For me, when I make a plugin for MC 1.17 or 1.17.1 - the main class throws errors, IJ cannot find e.g. the JavaPlugin class import. If I use the old artifacts for MC 1.16.5 and lower - it's all ok, the org.bukkit classes are found.

Kamilkime avatar Sep 27 '21 10:09 Kamilkime

After clearing Gradle and Maven caches from the io.papermc folders - seems like Gradle isn't even downloading the artifact correctly, but the old (pre 1.17) artifacts re-download correctly

Kamilkime avatar Sep 27 '21 11:09 Kamilkime

Ah yes somehow the project creator doesn't set the java version to 16. You have to modify your build.gradle manually.

RedNesto avatar Sep 27 '21 11:09 RedNesto

Yup, now that I've changed it - it downloads correctly. So it would probably be best to set targetJavaVersion to 16 when using the newer Paper builds

Kamilkime avatar Sep 27 '21 11:09 Kamilkime

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jan 09 '22 00:01 stale[bot]