13
0
geforkt von Mirrors/Velocity

Remove nextProtocolVersion from MinecraftConnection

ViaVersion was the only intended user. However, ViaVersion for Velocity 1.1.0 no longer uses this functionality, and so it doesn't make sense to keep it in Velocity 1.1.0.
Dieser Commit ist enthalten in:
Andrew Steinborn 2020-08-04 12:14:28 -04:00
Ursprung e57c6d00c0
Commit 87bff1a123
2 geänderte Dateien mit 1 neuen und 11 gelöschten Zeilen

Datei anzeigen

@ -60,7 +60,6 @@ public class MinecraftConnection extends ChannelInboundHandlerAdapter {
private StateRegistry state;
private @Nullable MinecraftSessionHandler sessionHandler;
private ProtocolVersion protocolVersion;
private ProtocolVersion nextProtocolVersion;
private @Nullable MinecraftConnectionAssociation association;
private final VelocityServer server;
private ConnectionType connectionType = ConnectionTypes.UNDETERMINED;
@ -333,7 +332,6 @@ public class MinecraftConnection extends ChannelInboundHandlerAdapter {
ensureInEventLoop();
this.protocolVersion = protocolVersion;
this.nextProtocolVersion = protocolVersion;
if (protocolVersion != ProtocolVersion.LEGACY) {
this.channel.pipeline().get(MinecraftEncoder.class).setProtocolVersion(protocolVersion);
this.channel.pipeline().get(MinecraftDecoder.class).setProtocolVersion(protocolVersion);
@ -419,14 +417,6 @@ public class MinecraftConnection extends ChannelInboundHandlerAdapter {
this.association = association;
}
public ProtocolVersion getNextProtocolVersion() {
return this.nextProtocolVersion;
}
public void setNextProtocolVersion(ProtocolVersion nextProtocolVersion) {
this.nextProtocolVersion = nextProtocolVersion;
}
/**
* Gets the detected {@link ConnectionType}.
* @return The {@link ConnectionType}

Datei anzeigen

@ -131,7 +131,7 @@ public class VelocityServerConnection implements MinecraftConnectionAssociation,
// Initiate the handshake.
InetSocketAddress destAddress = registeredServer.getServerInfo().getAddress();
ProtocolVersion protocolVersion = proxyPlayer.getConnection().getNextProtocolVersion();
ProtocolVersion protocolVersion = proxyPlayer.getConnection().getProtocolVersion();
Handshake handshake = new Handshake();
handshake.setNextStatus(StateRegistry.LOGIN_ID);
handshake.setProtocolVersion(protocolVersion);