Fixed bedrock connection issues on MacOS

This commit is contained in:
RaphiMC 2024-08-08 17:02:20 +02:00
parent 4bc610eb96
commit d5eaf320bc
No known key found for this signature in database
GPG Key ID: 0F6BB0657A03AC94

View File

@ -45,10 +45,11 @@ public class BedrockProxyConnection extends ProxyConnection {
}
@Override
public void initialize(final ChannelType channelType, final Bootstrap bootstrap) {
public void initialize(ChannelType channelType, final Bootstrap bootstrap) {
if (!DatagramChannel.class.isAssignableFrom(channelType.udpClientChannelClass())) {
throw new IllegalArgumentException("Channel type must be a DatagramChannel");
}
if (channelType == ChannelType.KQUEUE) channelType = ChannelType.NIO; // KQueue doesn't work for Bedrock for some reason
final Class<? extends DatagramChannel> channelClass = (Class<? extends DatagramChannel>) channelType.udpClientChannelClass();
bootstrap