PaperMC / Velocity

The modern, next-generation Minecraft server proxy.
https://papermc.io/software/velocity
GNU General Public License v3.0
1.68k stars 583 forks source link

Allow setting forwarding mode separately for different servers #1357

Open wafarm opened 2 weeks ago

wafarm commented 2 weeks ago

Fix #304

It is quite common to have a setup which includes both servers newer than 1.12 and older than 1.12. By allowing setting forwarding modes separately, we don't need to use the legacy forwarding mode all the time. Especially it is discontinued for newer fabric versions.

This PR is fully compatible with old config files and no changes to API are made.

You can find builds with this change included here: https://github.com/wafarm/Velocity/releases

paulzzh commented 1 week ago

Incompatible with Ambassador 1.4.4

[10:51:32 ERROR]: [server connection] Paulzzh -> SU: exception encountered in com.velocitypowered.proxy.connection.backend.LoginSessionHandler@5eb9676e
io.netty.handler.codec.EncoderException: java.lang.NoSuchMethodError: 'com.velocitypowered.proxy.config.PlayerInfoForwarding com.velocitypowered.proxy.config
.VelocityConfiguration.getPlayerInfoForwardingMode()'
Caused by: java.lang.NoSuchMethodError: 'com.velocitypowered.proxy.config.PlayerInfoForwarding com.velocitypowered.proxy.config.VelocityConfiguration.getPlayerInfoForwardingMode()'
        at org.adde0109.ambassador.velocity.backend.FMLMarkerAdder.encode(FMLMarkerAdder.java:32) ~[?:?]
        at org.adde0109.ambassador.velocity.backend.FMLMarkerAdder.encode(FMLMarkerAdder.java:19) ~[?:?]
        at io.netty.handler.codec.MessageToMessageEncoder.write(MessageToMessageEncoder.java:90) ~[velocity-3.3.0-SNAPSHOT-400.jar:3.3.0-SNAPSHOT (git-bb3d3b07)]
        ... 26 more
wafarm commented 6 days ago

Ambassador used getPlayerInfoForwardingMode, which is not part of velocity api and is renamed in this PR.

powercasgamer commented 6 days ago

Ambassador used getPlayerInfoForwardingMode, which is not part of velocity api and is renamed in this PR.

Don’t really see how that’s relevant? As you’ve already stated it’s not part of the API and thus subject to breaking changes.

wafarm commented 6 days ago

If a mod only uses com.velocitypowered:velocity-api as the dependency, it won't be affected. But Ambassador uses com.velocitypowered:velocity-proxy as well, and therefore it breaks due to the renamed method.

powercasgamer commented 6 days ago

If a mod only uses com.velocitypowered:velocity-api as the dependency, it won't be affected. But Ambassador uses com.velocitypowered:velocity-proxy as well, and therefore it breaks due to the renamed method.

Yes, but I don’t really see how that’s relevant? Using internals is not supported

wafarm commented 6 days ago

Yes, but I don’t really see how that’s relevant? Using internals is not supported

Yes, I'm just explaining why it's incompatible since he posted.