mirror of
https://github.com/ViaVersion/ViaProxy.git
synced 2024-11-07 09:40:42 +01:00
Fixed the fix
This commit is contained in:
parent
da798dec48
commit
ea186d09aa
@ -142,13 +142,15 @@ public class Client2ProxyHandler extends SimpleChannelInboundHandler<IPacket> {
|
|||||||
String address = packet.address.split("\0")[0];
|
String address = packet.address.split("\0")[0];
|
||||||
final VersionEnum clientVersion = VersionEnum.fromProtocolVersion(ProtocolVersion.getProtocol(packet.protocolVersion));
|
final VersionEnum clientVersion = VersionEnum.fromProtocolVersion(ProtocolVersion.getProtocol(packet.protocolVersion));
|
||||||
|
|
||||||
|
if (packet.intendedState != ConnectionState.STATUS && packet.intendedState != ConnectionState.LOGIN) {
|
||||||
|
throw CloseAndReturn.INSTANCE;
|
||||||
|
}
|
||||||
|
|
||||||
this.proxyConnection.setClientVersion(clientVersion);
|
this.proxyConnection.setClientVersion(clientVersion);
|
||||||
this.proxyConnection.setConnectionState(packet.intendedState);
|
this.proxyConnection.setConnectionState(packet.intendedState);
|
||||||
|
|
||||||
if ((ConnectionState.LOGIN.equals(packet.intendedState) || ConnectionState.STATUS.equals(packet.intendedState)) && clientVersion == VersionEnum.UNKNOWN) {
|
if (clientVersion == VersionEnum.UNKNOWN) {
|
||||||
this.proxyConnection.kickClient("§cYour client version is not supported by ViaProxy!");
|
this.proxyConnection.kickClient("§cYour client version is not supported by ViaProxy!");
|
||||||
} else if (!ConnectionState.STATUS.equals(packet.intendedState)) {
|
|
||||||
throw CloseAndReturn.INSTANCE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.customPayloadPacketId = MCPackets.C2S_PLUGIN_MESSAGE.getId(clientVersion.getVersion());
|
this.customPayloadPacketId = MCPackets.C2S_PLUGIN_MESSAGE.getId(clientVersion.getVersion());
|
||||||
|
Loading…
Reference in New Issue
Block a user