Don't hook VV into pipeline if target == native ver

This commit is contained in:
FlorianMichael 2024-04-28 22:38:17 +02:00
parent 325494824c
commit d2d5ed4458
No known key found for this signature in database
GPG Key ID: C2FB87E71C425126
1 changed files with 4 additions and 0 deletions

View File

@ -90,6 +90,10 @@ public class ViaForgeCommon {
*/
public void inject(final Channel channel, final VFNetworkManager networkManager) {
if (channel instanceof SocketChannel) {
if (targetVersion.equals(getNativeVersion())) {
return; // Don't inject ViaVersion into pipeline if there is nothing to translate anyway
}
final UserConnection user = new UserConnectionImpl(channel, true);
new ProtocolPipelineImpl(user);