13
0
geforkt von Mirrors/Velocity

Fix the 1.7+ SLP stuff.

Props to @Minecrell
Dieser Commit ist enthalten in:
Andrew Steinborn 2018-07-24 14:25:44 -04:00
Ursprung 8371073f91
Commit 354d60b036
3 geänderte Dateien mit 8 neuen und 8 gelöschten Zeilen

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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