Fix the 1.7+ SLP stuff.

Props to @Minecrell
This commit is contained in:
Andrew Steinborn 2018-07-24 14:25:44 -04:00
parent 8371073f91
commit 354d60b036
3 changed files with 8 additions and 8 deletions

View File

@ -43,26 +43,26 @@ public class ServerPing {
public static class Version {
private final int protocol;
private final String version;
private final String name;
public Version(int protocol, String version) {
public Version(int protocol, String name) {
this.protocol = protocol;
this.version = version;
this.name = name;
}
public int getProtocol() {
return protocol;
}
public String getVersion() {
return version;
public String getName() {
return name;
}
@Override
public String toString() {
return "Version{" +
"protocol=" + protocol +
", version='" + version + '\'' +
", name='" + name + '\'' +
'}';
}
}

View File

@ -21,7 +21,7 @@ public class MinecraftDecoder extends MessageToMessageDecoder<ByteBuf> {
@Override
protected void decode(ChannelHandlerContext ctx, ByteBuf msg, List<Object> out) throws Exception {
if (msg.isReadable()) {
if (!msg.isReadable()) {
return;
}

View File

@ -74,7 +74,7 @@ public class LegacyPingResponse {
public static LegacyPingResponse from(ServerPing ping) {
return new LegacyPingResponse(ping.getVersion().getProtocol(),
ping.getVersion().getVersion(),
ping.getVersion().getName(),
ComponentSerializers.LEGACY.serialize(ping.getDescription()),
ping.getPlayers().getOnline(),
ping.getPlayers().getMax());