diff --git a/src/main/java/io/minimum/minecraft/velocity/data/ServerPing.java b/src/main/java/io/minimum/minecraft/velocity/data/ServerPing.java index 6c6314dd1..7f9e5a658 100644 --- a/src/main/java/io/minimum/minecraft/velocity/data/ServerPing.java +++ b/src/main/java/io/minimum/minecraft/velocity/data/ServerPing.java @@ -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 + '\'' + '}'; } } diff --git a/src/main/java/io/minimum/minecraft/velocity/protocol/netty/MinecraftDecoder.java b/src/main/java/io/minimum/minecraft/velocity/protocol/netty/MinecraftDecoder.java index a7dad5d89..aecfeb728 100644 --- a/src/main/java/io/minimum/minecraft/velocity/protocol/netty/MinecraftDecoder.java +++ b/src/main/java/io/minimum/minecraft/velocity/protocol/netty/MinecraftDecoder.java @@ -21,7 +21,7 @@ public class MinecraftDecoder extends MessageToMessageDecoder { @Override protected void decode(ChannelHandlerContext ctx, ByteBuf msg, List out) throws Exception { - if (msg.isReadable()) { + if (!msg.isReadable()) { return; } diff --git a/src/main/java/io/minimum/minecraft/velocity/protocol/packets/LegacyPingResponse.java b/src/main/java/io/minimum/minecraft/velocity/protocol/packets/LegacyPingResponse.java index 29347dd35..ff937fd7c 100644 --- a/src/main/java/io/minimum/minecraft/velocity/protocol/packets/LegacyPingResponse.java +++ b/src/main/java/io/minimum/minecraft/velocity/protocol/packets/LegacyPingResponse.java @@ -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());