Where do I make my plugin?


#1

So I’ve been modding for a while but decided to get into plugins just recently. I setup my eclipse environment for sponge and I have the three folders SpongeCommon, SpongeForge, and SpongeAPI in my package explorer. Now what I’m trying to figure out is where to start making my plugin. I made a package inside of SpongeForge/src/main/java but I’m not sure if this is the right place to start making the plugin if I want to be able to build it correctly once I’m done. If anyone could help that would be awesome


#2

You don’t modify sponge to make a plugin. You setup a spongeforge workspace in order to develop spongeforge.
To make plugins, create a new project and add spongeapi as a dependency.
See the documentation for details: https://docs.spongepowered.org/stable/en/plugin/index.html
Keep the spongeforge project around though, for testing your plugin you can launch spongeforge with your plugin project added as a dependency.


#3

So would I just create a new gradle project as I would normally? Also, how would I go about making spongeapi a dependency in that project? Would I just have to add:
dependencies { compile 'org.spongepowered:spongeapi:7.1.0' }
or is there something else that I’m missing. And do I need SpongeForge as a dependency or is it just the SpongeApi that I need?


#4

Yes, you create a new project.
See the documentation for a template gradle file: https://docs.spongepowered.org/stable/en/plugin/project/gradle.html
You do not need to add SpongeForge as a dependency if you only intend to make a plugin using SpongeAPI.


#5

What functionality does SpongeForge implement that doesn’t come with SpongeAPI?


#6

The first thing to understand is what the architecture of a sponge server is.
Give this page a read: https://docs.spongepowered.org/stable/en/about/structure.html

SpongeAPI is what you use to write plugins, SpongeForge/SpongeVanilla is what you use to run the plugin.