Hey guys, I’ve wanted to try out Sponge as soon as I heard that the JAR-File is available
So I followed the Docs to create my first Command with the CommandSpec-Builder but now I have an error with registering the command…
So the line game.getCommandDispatcher().register(this, sp, "hallo", "hi"); is underlined red and eclipse is giving me the error: The type com.google.common.base.Function cannot be resolved. It is indirectly referenced from required .class files
Sometimes it’s not Function but Optional and the import isn’t available
My Sponge-Version is 439, I hope you guys understand my problem apart from my bad english(I guess )
Ok, I did it now. I’m kinda new to Maven, cause I never used it before
But one last question: How do I export the plugin, just normal? And about the folder hierarchy… should my main class go there: Picture ?
That is correct, that would be where you put your main class. To build your plugin, just run mvn clean install in the root directory of your plugin, and the newly built jar will be in the target folder
The best way to do it (for future usability) would be to add Maven to your PATH: Here is a tutorial for Windows, Mac, and Linux (about half-way down the page). Then, just cd to your plugin’s root directory (in the command line/terminal) and run mvn clean install
Ah ok now I’ve managed to compile it with maven and get the final jar
But if I extract the jar, there’s no difference in the folders between the normal exported jar…
So I guess, I needed to use maven, 'cause of the sponge-jar? ;D
I extracted it to see the difference between maven compiling and just exporting the jar xD I know where to put the jar, that was just something that I wanted to know ;D But yeah there’s no big difference if you do that.
You should use Maven because it does all the jobs for you.
Add a pom.xml, let Maven grab everything your plugin needs, code your plugin, ???, Profit!
And, yes, the jar will be pretty much the same.