Fix 1.20.2 ProtocolAutoDetector

This commit is contained in:
Nassim Jahnke 2023-09-21 11:29:55 +10:00
parent ffd7e0bc23
commit 957b62620c
2 changed files with 7 additions and 4 deletions

View File

@ -3,11 +3,11 @@
org.gradle.jvmargs=-Xms32M -Xmx4G -XX:+UseG1GC -XX:+UseStringDeduplication
loader_version=0.14.21
viaver_version=4.8.0-1.20.2-rc1-SNAPSHOT
viaver_version=4.8.0-1.20.2-rc2-SNAPSHOT
yaml_version=2.0
publish_mc_versions=1.20.1, 1.19.4, 1.18.2, 1.17.1, 1.16.5, 1.15.2, 1.14.4, 1.8.9
# example: 1.19.1-rc1. Can be a blank value
modrinth_mc_snapshot=1.20.2-rc1
modrinth_mc_snapshot=1.20.2-rc2
# example: 1.19-Snapshot. Can be a blank value
curseforge_mc_snapshot=1.20.2-Snapshot

View File

@ -52,10 +52,10 @@ public class ProtocolAutoDetector {
.handler(new ChannelInitializer<>() {
@Override
protected void initChannel(@NotNull Channel channel) {
channel.attr(ClientConnection.SERVERBOUND_PROTOCOL_KEY)
.set(NetworkState.HANDSHAKING.getHandler(NetworkSide.SERVERBOUND));
channel.attr(ClientConnection.CLIENTBOUND_PROTOCOL_KEY)
.set(NetworkState.STATUS.getHandler(NetworkSide.CLIENTBOUND));
channel.attr(ClientConnection.SERVERBOUND_PROTOCOL_KEY)
.set(NetworkState.STATUS.getHandler(NetworkSide.SERVERBOUND));
try {
channel.config().setOption(ChannelOption.TCP_NODELAY, true);
channel.config().setOption(ChannelOption.IP_TOS, 0x18); // Stolen from Velocity, low delay, high reliability
@ -115,6 +115,9 @@ public class ProtocolAutoDetector {
address.getPort(),
ConnectionIntent.STATUS
));
ch.channel().attr(ClientConnection.SERVERBOUND_PROTOCOL_KEY)
.set(NetworkState.STATUS.getHandler(NetworkSide.SERVERBOUND));
clientConnection.send(new QueryRequestC2SPacket());
});
}