Bukkit to sponge?

Hello, I have a plugin with “Bukkit” and “Spigot” in my build paths. I’m doing a sponge plugin with the 2.0 API. But cannot resolve a lot of methods… Help me please :smile:

You need to target the 2.1-SNAPSHOT. 2.0 API is vastly different from the latest 2.1-SNAPSHOTs.

Also, I’d recommend that you use either Maven or Gradle to handle dependency resolution as explained here.

Thanks, I’ve found this file : “spongeapi-2.0.jar”
here http://repo.spongepowered.org/Sponge/maven/org/spongepowered/spongeapi/

I’m French, I don’t understand what I have to do in this page :frowning:

“Maven Repository: http://repo.spongepowered.org/maven” Which one to dl ?
“Examples” What is that ? What I have to do with that ? “Gradle” and “Maven”

BTW The docs are translated, here’s the French version:

I think I’m good with config now.
So now I need to import… How to find bukkit->sponge ?

There is no exact mapping of bukkit classes to sponge, as the APIs are vastly different. A plugin may have to be rewritten entirely.
I recommend taking a look at the docs, several topics are already explained there (some might even be translated into french).
Many question also have been answered in the forums - and if they weren’t you just ask your own.

Omg ok thanks.
So I can find all those stuffs ? =>
“FileConfiguration”, “getServer( )”, “ItemStack”, “addUnsafeEnchantment( )”, “getOfflineUser( )”, “getLogger( )”
etc … ?

And for example I can’t find an equivalent of “PlayerJoinEvent” :’(
It will be so haaaaard :cold_sweat:

FileConfigurationConfigurate Docs
getServer(), getLogger()Dependency Injection Docs
addUnsafeEnchantment()Data API Docs, EnchantmentData class
PlayerJoinEventClientConnectionEvent.Join or ClientConnectionEvent.Login, depending on what you want to do
getOfflineUser()Service Docs, UserStorage

Maybe. But rewarding. I’ve linked you the french documentation. If you encounter english text their, that means this section has not been translated yet. The best of luck.


Ho thank you so much ! And then when I’m finished, I can compile into a .jar a put it on my craftbukkit server or I have to user sponge in my server ? Because I have a lot of bukkit plugins !

Obviously, Sponge plugins will only be working with the Sponge API. As CraftBukkit does not provide this API, sponge plugins won’t work. Putting them in your CraftBukkit’s plugin folder will do exactly nothing, as CraftBukkit will neither recognise nor load them.

I also should probably make you aware of Pore, a Sponge plugin in development that aspires to provide an implementation of the Bukkit API on top of Sponge (vulgo: Allows you to run Bukkit plugins on a Sponge server).

I do not know how much is implemented / if it is usable already though.