mirror of
https://github.com/PaperMC/Velocity.git
synced 2024-11-27 06:30:35 +08:00
Fix the 1.7+ SLP stuff.
Props to @Minecrell
This commit is contained in:
parent
8371073f91
commit
354d60b036
@ -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 + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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());
|
||||
|
Loading…
Reference in New Issue
Block a user