Forge client behavior with vanilla servers

Hey everyone! I’ve got a question about forge’s client behavior. Let me give you the scenario first:

We’re running a bungeecord network with an SMP server and a minigames server attached. There also is a lobby server where people spawn when they log in. These servers are all running spigot. Recently, we wanted to add a modded server to our offerings. For this we (pretty obviously) wanted to use sponge. That server is now almost completed and we went to add it to the bungeecord network. We had previously tested the clientside modpack on the lobby server and it could join just fine, because forge lets you join vanilla (or with a vanilla protocol at least) servers while you have mods loaded.

That’s where my issue is and what my question is about. When I wanted to go to our modded server from our lobby, it told me “Kicked whilst connecting to Modded: This server requires FML/Forge to be installed. Contact your server admin for more details” and I wish I could contact my server admin, but that’s me (among others :P).

To me this looks like forge is (soft-)disabling itself when you join a vanilla server (the lobby in this case). Is there any way to let forge detect that you want to switch to a modded server? Or is this hardcoded into forge? How are other mixed vanilla/modded servers doing this? I can’t find any real documentation about joining vanilla servers with forge and how it works exactly. What happens behind the screens? Is this manipulable?

The obvious answer would be to make our lobby server into a spongeforge server, but I’d rather not do that since that’s a lot of work to redo that whole server, even though that will certainly solve our problems.

Any help would be really appreciated!

EDIT: thought I should clarify: I have enabled ip-forwarding with sponge, and I’m using SpongePls to make this work.

To answer this question you have to understand how Bungee works. There’s no such thing as ‘switching’ servers, at least not to the vanilla client. When you connect to the proxy server, Bungee connects to the real server, pretending to be you. Any packets sent to the Bungee proxy get sent to the client, except for specific plugin message packets. The Bungee proxy disconnects from server A, and reconnects to server B, while the player only receives a world change packet. I’m going to guess that the Bungee proxy isn’t prepared to connect to Forge.

Yes, @blood and I wrote that into BungeeCord back in 2014. When you switch servers, Bungee should be sending a FML Reset packet and instructing the client that we’re about to change mods. This happens whenever a switch is about to occur and Forge is detected.

Now, in Forge 1.8+, Forge adds a \0FML\0 tag to the handshake, which IP Forwarding tries to drop - that again was a PR of mine because at the time, I thought that the Spigot team would be accommodating when a better solution came around. That, it turns out, causes the problem you’re seeing now. I wrote a PR to try to solve this in two different ways, the second of which did not break the protocol for earlier Spigot servers, neither of which have been accepted or rejected. The counterparts in Sponge, on the other hand, were accepted quickly. What SpongePls does is it tries to apply my PRs using a plugin, but adds configuration. I created a similar plugin to show it could be done without configuration, but it probably doesn’t work any more.

My guess is that either SpongePls no longer works, or it’s misconfigured. My actual advice would be to replace Bungee with Waterfall, which does contain my fixes to be compatible with SpongeForge, and doesn’t require SpongePls.

Also, just checking this, but make sure you have the BungeeCord module AND the BungeeCord option in the Sponge config enabled.

I had triple checked all my configuration, except for SpongePls. That’s where my problem was at. It now works just fine and exactly how it’s supposed to. Thank you both for your quick and helpful replies!

For everyone else, I just made this mistake too:
Check yo’ configuration

For anyone with the same problem that was wondering what I did wrong and how they can fix it: In the spongepls config you need to specify the “allowed-servers”. I put all the spigot servers in that list instead of the modded one.

1 Like