Manually merge in conflicting 2.0.0 changes into the 1.1.0 merge.

This commit is contained in:
Andrew Steinborn
2020-10-28 20:36:22 -04:00
parent e21cd77ae7
commit 8dd83193c8
3 changed files with 17 additions and 22 deletions

View File

@@ -4,7 +4,6 @@ import com.google.common.base.Preconditions;
import com.google.common.base.Strings;
import java.util.Objects;
import java.util.regex.Pattern;
import net.kyori.minecraft.Key;
import org.checkerframework.checker.nullness.qual.Nullable;
/**
@@ -70,16 +69,6 @@ public final class MinecraftChannelIdentifier implements ChannelIdentifier {
return create(namespace, name);
}
/**
* Creates an channel identifier from the specified Minecraft identifier.
*
* @param key the Minecraft key to use
* @return a new channel identifier
*/
public static MinecraftChannelIdentifier from(Key key) {
return create(key.namespace(), key.value());
}
public String getNamespace() {
return namespace;
}
@@ -88,10 +77,6 @@ public final class MinecraftChannelIdentifier implements ChannelIdentifier {
return name;
}
public Key asKey() {
return Key.of(namespace, name);
}
@Override
public String toString() {
return namespace + ":" + name + " (modern)";

View File

@@ -120,7 +120,7 @@ public class StatusSessionHandler implements MinecraftSessionHandler {
continue;
}
if (response.getDescriptionComponent() == null) {
if (response.getDescription() == null) {
continue;
}

View File

@@ -16,10 +16,12 @@ import com.velocitypowered.api.proxy.config.ProxyConfig;
import com.velocitypowered.api.proxy.server.RegisteredServer;
import com.velocitypowered.api.util.ProxyVersion;
import io.netty.channel.unix.DomainSocketAddress;
import java.net.Inet4Address;
import java.net.Inet6Address;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.SocketAddress;
import java.util.List;
import java.util.Map;
@@ -168,14 +170,22 @@ public enum InformationUtils {
public static JsonObject collectServerInfo(RegisteredServer server) {
JsonObject info = new JsonObject();
info.addProperty("currentPlayers", server.getPlayersConnected().size());
InetSocketAddress iaddr = server.getServerInfo().getAddress();
if (iaddr.isUnresolved()) {
// Greetings form Netty 4aa10db9
info.addProperty("host", iaddr.getHostString());
SocketAddress address = server.getServerInfo().getAddress();
if (address instanceof InetSocketAddress) {
InetSocketAddress iaddr = (InetSocketAddress) address;
if (iaddr.isUnresolved()) {
// Greetings form Netty 4aa10db9
info.addProperty("host", iaddr.getHostString());
} else {
info.addProperty("host", anonymizeInetAddress(iaddr.getAddress()));
}
info.addProperty("port", iaddr.getPort());
} else if (address instanceof DomainSocketAddress) {
DomainSocketAddress daddr = (DomainSocketAddress) address;
info.addProperty("path", daddr.path());
} else {
info.addProperty("host", anonymizeInetAddress(iaddr.getAddress()));
info.addProperty("info", address.toString());
}
info.addProperty("port", iaddr.getPort());
return info;
}