ViaVersion icon indicating copy to clipboard operation
ViaVersion copied to clipboard

Remove Netty from the API

Open akobusinski opened this issue 2 years ago • 5 comments

Problem Description

Due to the fact that the current API depends on Netty, there's no easy way of integrating it with a server that uses anything other than Netty, for example Minestom that uses java.nio

Solution Description

Remove the use of Netty classes in the API. One way of doing this could be by creating a new interface that replaces the Netty channel. Same with the Netty ByteBuf.

Alternatives

No response

Additional Info

The only issue I can see with this is the fact that its a breaking change.

If you're okay with it, I can create a draft PR and start working on it.

akobusinski avatar Jan 20 '24 18:01 akobusinski

This is something we probably have to do anyways given netty 5, but this will have to wait for a major version bump given it'd be fairly disruptive - at the moment none is planned for the near future, and as of now we don't have much reason to already do the break.

A workaround for the minestom case until then is to use ViaProxy, or to put ViaVersion on Velocity/Bungee

kennytv avatar Jan 20 '24 19:01 kennytv

Are there other dependencies that may be deprecated in case this breaking change does occur?

Kichura avatar Jan 20 '24 19:01 Kichura

A workaround for the minestom case until then is to use ViaProxy, or to put ViaVersion on Velocity/Bungee

I'm aware that you can put Minestom behind a proxy, but in my opinion that's a pretty hacky workaround since you have to spin up a proxy just for that one server.

Are there other dependencies that may be deprecated in case this breaking change does occur?

I don't think there's anything else.

akobusinski avatar Jan 20 '24 19:01 akobusinski

ViaVersion on the proxy unfortunately isn't a real option for us due to anti-cheat even though the versions we would allow to be translated would be very small, the changes between 1.19.x and 1.20.x or even 1.20.1 and 1.20.4 are significant enough to cause issues with anti-cheats. We did some work for this at some point of ripping netty-buffers outside of netty and wrapping NIO: https://netty.io/wiki/using-as-a-generic-library.html

0-x-2-2 avatar Jan 30 '24 00:01 0-x-2-2

Removing Netty from the API would not only break ViaVersion but also all other projects depending on it such as ViaFabricPlus or ViaLegacy, it's something for an major version bump and this definitely won't happen just because someone wants Minestorm support.

florianreuth avatar Jan 30 '24 12:01 florianreuth