SpongeForge and Bukkit plugins


#1

I’ve been reading on the forums for a few hours, and I don’t quite get why Bukkit plugins aren’t compatible with Sponge. What about SpongeAPI is so much better about the old Bukkit API? It seems like 6 years of work, from hundreds of developers, is just being thrown out, just to start all over. I did hear about Pore, but that was discontinued. Is there any other plugin I can try?

The reason I ask this is because my ideal server is having certain mods and certain bukkit plugins working together for a more fun experience than only mods or only plugins. When I found Sponge, I thought I found what I was looking for, but I was mistaken, because many of the plugins I want (Worldedit, Multiverse, MCMMO, EssentialsX, etc.) aren’t ported or aren’t updated, when spigot has all the bukkit plugins updated months ago. Not to mention the fact that sponge is buggy and doesn’t always load mods that normally work fine on a forge server.

Overall, while sponge is an amazing project and I would love for it to flourish into the future of servers with both plugins and mods, it just seems unrealistic. It would take years to get even the most popular plugins ported because there are hundreds of them, then having to fix all the bugs in Sponge on top of that. It also doesn’t seem very active, compared to spigot, for example.

My point is that, as far as I know, it seems like it would be far easier to just make sponge compatible with bukkit plugins and focus mostly on compatibility with forge, because once it is, it can load anything forge can.

I really don’t know much about the API for Sponge or Bukkit, so any time you could take to explain why the API is the way it is would be much appreciated.

Sorry if this has been talked about a lot, but everything I’ve read is from years ago and would like an update on the topic.


Sponge & Spigot
Sponge plugins compatibility
#2

Sponge is not Cauldron, it’s not just something to link bukkit and forge, it’s an entirely different API. You can’t pretend it to be what you want since it’s not its nature


#3

Right. So the huge problem with the Bukkit API was that it had a DMCA takedown just before minecraft 1.8 was released. This means Bukkit were not allowed to update it anymore (they currently get around updating the API and the rest of Bukkit using a very grey method). This causes others who wish to create there own server running plugins jobs very difficult as they normally need to wait for spigot to update the code and then they can implement the updated Bukkit api.

And around the same time of the DMCA takedown SpongeAPI started development. With the Bukkit API in mind. However it was not allowed to copy the BukkitAPI as thats Bukkit’s not Sponge’s.

Another huge reason why Sponge was developed was because the BukkitAPI has always had huge bits missing out of it. This lead to developers having to use another API called NMS (Network Minecraft Server - or Not Much Sense - p.s the latter is a joke). The NMS API is the direct interface the normal minecraft server uses, this means that if a plugin was not programmed correctly in the horrible interface of NMS, it could do serious damage to the server itself.

SpongeAPI doesn’t have those holes (or at least tries to). This means even the worst plugin developer only needs to learn the SpongeAPI to have access to the whole of what is possible with plugins and does not need to dive into the complex mess that NMS is.

I could go on about how Sponge and Bukkit use NMS and the effects of it. But in my option, I would prefer not having to use it and use the interface that gave me the most to mess around with. (Just a quick one. By not using NMS it means plugins can sometimes work without any changes on the next Minecraft server. While NMS plugins do need to).

Enter Pore. Pore was essentially a emulator, it had the Bukkit API and converted it into Sponge. However, due to the way Sponge and Bukkit interact with NMS, the Bukkit plugins that used NMS (remeber there are a lot of holes in BukkitAPI - so most plugins used NMS) would not work as it is impossible emulate NMS if it is already there (i know that may not make sense. Without getting too technical, the way you get NMS in bukkitAPI and the way you get NMS in SpongeAPI are not compatible with each other, and you can not make it compatible). This means that even if Pore was made and working it would only support a small number of plugins. Finding thouse plugins would be difficult too due to the fact developers don’t say if there plugin uses NMS or not.

Overall. SpongeForge and SpongeVannila can not run the BukkitAPI even if they wanted to due to compatiblilty issues with NMS. However they don’t want to due to the DMCA takedown.

Hope that clears up the confusion. Sorry if anything is misspelled or has grammer issues. I am dislexic.

P.S worldedit does have a sponge and forge version.


#4

Your grammar is perfectly fine. Thank you for explaining it. That clears up SO many questions I had. I’m also interested in plugin development and would love to be apart of the sponge community. I’d really like to work on porting over Multiverse, and MCMMO, but I’m really not sure how to get started porting complex plugins like that. Do you have any tutorial recommendations?

I forgot I could use the forge version of worldedit, but that was more of an example. There aren’t any forge versions of Multiverse or MCMMO that I know of, though.


#5

Right. So the first thing to do is check the licencing of the plugins you wish to port over. If its open source then you can port it. If not you need the original developers permission to port it (unless they have a licence I don’t know about … Then you maybe able to port it …).

Next up. If you haven’t already. Learn Java. The more of Java you learn the better. But with plugins, you can probably get away with learning the bare minimum.
A tutorial I recommend for that is the official one

https://docs.oracle.com/javase/tutorial/

After that you will hopfully be ready to learn the backbone to sponge. Aka. the SpongeAPI.

The SpongeDocs is a great place to start learning the SpongeAPI. However some of the newer tricks and just some stuff in general is not on the SpongeDocs (as the code keeps updating, the tutorial writers can not keep up). So thats when I personally turn the forums as search for a way to do it.

Here is the spongeDocs on Create a plugin in GB English

https://docs.spongepowered.org/stable/en-GB/plugin/index.html

Edit:

Also, don’t do what I did to learn and jump into the deep end. Try and create some basic plugins and get more advanced from there.


#6

There’s quite a few alternatives in sponge to those plugins you listed. EssentialsX -> Nucleus, Worldedit -> WorldEdit, McMMO -> AdventureMMO. I’m not entirely sure on what Multiverse was about, from a quick look it seems it was a world management plugin. Nucleus does a fine job of that on its own, though not to the extent it looks that Multiverse had.

EDIT: I can vouch for what @MoseMister said. My first released plugin here was a wild ride as I was learning how to use Sponge, and I was actually also learning Java at that time too which didn’t help with the quality. Think small and expand as you go on.


#7

Most of what has been said already covers it, but there are two things I want to add:

  1. Sponge was designed to work with Forge and mods, Bukkit was not, and the previous attempt, Cauldron, was always a bit hacky. The person who maintained Cauldron is a lead of Sponge now - so the experience is there as to what works and what doesn’t.
  2. Sponge, as a later API, is trying to learn from what was good and bad about Bukkit. Bukkit is showing its age - the Minecraft system has changed a lot (1.7 -> 1.8 was a big change). Bukkit mirrored the implementation somewhat (so with things like integer IDs and damage value, which are going away in 1.13) which the Bukkit API may find hard to cope with, while Sponge tries to be a bit more decoupled from the implementation in order to make it easier to absorb changes in the Minecraft API.

The Sponge API may seem quite a steep learning curve at first, but it’s designed to be stable going forward. We do have good docs, thanks to the docs team, and we’re here to help too. So please reach out when you don’t understand something about the API.

Aside: There is a lot of stuff about the DMCA going around, if you search the forums, there have been many many discussions over it, none of which I wish to repeat again, but if you’re interested, it’s buried in the forums somewhere.


Alternative to pore?
#8

Welcome to the Weird World of Sponge!

It’s probably worth noting that the link above (thanks @RysingDragon) is a native Sponge version of WorldEdit. Also, the plugin Project Worlds is similar in function to Multiverse.

I’d also encourage you to read the SpongeDocs, as some of what’s been said here is already discussed there.


#9

AdventureMMO hasn’t been updated in nearly 7 months. Worldedit hasn’t been updated in 9 months, but I can use the forge version. Nucleus works, though. Thanks.


#10

Project Worlds gives me an error, but thanks for the suggestion. I’ll see if they can help me.

Edit: I might not need Project Worlds if Nucleus works out. It looks to have similar commands that Multiverse had.


#11

Nucleus is modular, so you can turn off the world part of Nucleus so that it won’t fight with Project Worlds. However, if Nucleus is good enough for your needs then don’t worry about it. I’m not sure how they compare in terms of features.

If you have problems/errors with a plugin (after reasonable* testing) it’s usually worth letting the developer know.

(* for some values of “reasonable”)


#12

I’ve been trying to test out the ‘/world create’ command and it’s not working. Just keeps telling me “Invalid Argument.” I typed this exactly: ‘/world create -p the_void Void’ which is copy and paste from the Nucleus docs.


#13

Nucleus doesn’t throw that error back, AFAIK - it should be more helpful than that. Try replacing /world with /nworld - in case it’s a command that took over Nucleus’ world command.


#14

May I suggest joining the Nucleus Discord, and be able to get assistance from the fabulous community there? A lot of Sponge plugins have Discord for support, and Sponge IRC channels are also mirrored onto our own Sponge Discord too. Not that we want to suppress discussion here, but it’s often a better way to pursue the nitty-gritty of sorting out plugin issues.


#15

/nworld isn’t recognized as a command for some reason. I checked the config file, and nworld is set to true as an alias, so maybe it’s the version I have? I’ll message you on the discord if that’s okay.

Nucleus-1.2.0-PR1.2-S7.0-MC1.12.1-plugin


#16

To answer some of your other confusions:

First of all, Sponge bugs are getting rarer and rarer. No sense giving up now while we’re so close. And a lot of failed loading is just Sponge not loading first, which can be solved easily with SpongeBootstrap, or with mistakenly using the wrong versions.

It would definitely not be easier just to make Sponge compatible with Bukkit. The structure of the API is fundamentally different, and this is largely due to a couple of reasons.

  1. Bukkit refused to break anything, ever (two huge breaks in 1.7 notwithstanding), and as such the API’s design represents a much older version of Minecraft. Examples: The Material enum vs ItemTypes and BlockTypes being separate, the lack of a text-component API vs Sponge’s focusing on the Text class, numerical IDs.
  2. Bukkit was designed as an entirely managed API, while with Sponge you’re usually using the actual game’s objects. Bukkit operates via proxies, handles, etc. to convert its classes back and forth to Minecraft ones, and Sponge operates on a mixin system, making Minecraft/Forge classes implement its own interfaces at runtime. That alone would make Bukkit compatibility very difficult.
  3. Bukkit is designed for vanilla, and as such can afford to make some assumptions with its API and its implementation. Meanwhile, Sponge’s systems are often designed either directly around equivalent Forge systems, or with compatibility in mind. A prime example of this would be Bukkit’s consistent use of enums, which can’t be extended dynamically for e.g. mod items or blocks without horrible and fragile hackery, and another example would be its system of fully reloading which Sponge would have to change a lot of behavior to support.

As someone who used to write Bukkit plugins, I can tell you that the Sponge API is incredibly better in nearly every aspect (still waiting on a maps API :stuck_out_tongue: but that’s it) . The current ideology here, which I am a fan of, is to never be afraid to break something between major versions, in the name of always having the best possible API. Maintaining compatibility with an extremely dated API runs directly contrary to that.

As a final note: Pore has been attempted a few times. It’s never been completed; everyone who tries, eventually gives up. This is a testament to just how difficult it would be to support Bukkit at all.