diff --git a/example/src/main/java/org/geysermc/mcprotocollib/protocol/example/MinecraftProtocolTest.java b/example/src/main/java/org/geysermc/mcprotocollib/protocol/example/MinecraftProtocolTest.java index db88bcae7..277e5e8d3 100644 --- a/example/src/main/java/org/geysermc/mcprotocollib/protocol/example/MinecraftProtocolTest.java +++ b/example/src/main/java/org/geysermc/mcprotocollib/protocol/example/MinecraftProtocolTest.java @@ -61,9 +61,9 @@ public static void main(String[] args) { server.setGlobalFlag(MinecraftConstants.VERIFY_USERS_KEY, VERIFY_USERS); server.setGlobalFlag(MinecraftConstants.SERVER_INFO_BUILDER_KEY, session -> new ServerStatusInfo( - new VersionInfo(MinecraftCodec.CODEC.getMinecraftVersion(), MinecraftCodec.CODEC.getProtocolVersion()), - new PlayerInfo(100, 0, new ArrayList<>()), Component.text("Hello world!"), + new PlayerInfo(100, 0, new ArrayList<>()), + new VersionInfo(MinecraftCodec.CODEC.getMinecraftVersion(), MinecraftCodec.CODEC.getProtocolVersion()), null, false ) diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/ServerListener.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/ServerListener.java index 3d72d0db0..771b6cd65 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/ServerListener.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/ServerListener.java @@ -156,9 +156,9 @@ public void packetReceived(Session session, Packet packet) { ServerInfoBuilder builder = session.getFlag(MinecraftConstants.SERVER_INFO_BUILDER_KEY); if (builder == null) { builder = $ -> new ServerStatusInfo( - new VersionInfo(protocol.getCodec().getMinecraftVersion(), protocol.getCodec().getProtocolVersion()), - new PlayerInfo(0, 20, new ArrayList<>()), Component.text("A Minecraft Server"), + new PlayerInfo(0, 20, new ArrayList<>()), + new VersionInfo(protocol.getCodec().getMinecraftVersion(), protocol.getCodec().getProtocolVersion()), null, false ); diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/data/status/ServerStatusInfo.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/data/status/ServerStatusInfo.java index e1c0f813c..73556925f 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/data/status/ServerStatusInfo.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/data/status/ServerStatusInfo.java @@ -12,9 +12,9 @@ @Setter(AccessLevel.NONE) @AllArgsConstructor public class ServerStatusInfo { - private @Nullable VersionInfo versionInfo; - private @Nullable PlayerInfo playerInfo; private @NonNull Component description; + private @Nullable PlayerInfo playerInfo; + private @Nullable VersionInfo versionInfo; private byte[] iconPng; private boolean enforcesSecureChat; } diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/status/clientbound/ClientboundStatusResponsePacket.java b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/status/clientbound/ClientboundStatusResponsePacket.java index 59b369102..5d25a89b1 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/status/clientbound/ClientboundStatusResponsePacket.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/protocol/packet/status/clientbound/ClientboundStatusResponsePacket.java @@ -83,7 +83,7 @@ public ServerStatusInfo parseInfo() { enforcesSecureChat = data.get("enforcesSecureChat").getAsBoolean(); } - return new ServerStatusInfo(version, players, description, icon, enforcesSecureChat); + return new ServerStatusInfo(description, players, version, icon, enforcesSecureChat); } public ClientboundStatusResponsePacket withInfo(@NonNull ServerStatusInfo info) { diff --git a/protocol/src/test/java/org/geysermc/mcprotocollib/protocol/MinecraftProtocolTest.java b/protocol/src/test/java/org/geysermc/mcprotocollib/protocol/MinecraftProtocolTest.java index 0578034dc..bd6b2e7b0 100644 --- a/protocol/src/test/java/org/geysermc/mcprotocollib/protocol/MinecraftProtocolTest.java +++ b/protocol/src/test/java/org/geysermc/mcprotocollib/protocol/MinecraftProtocolTest.java @@ -33,9 +33,9 @@ public class MinecraftProtocolTest { private static final int PORT = 25562; private static final ServerStatusInfo SERVER_INFO = new ServerStatusInfo( - new VersionInfo(MinecraftCodec.CODEC.getMinecraftVersion(), MinecraftCodec.CODEC.getProtocolVersion()), - new PlayerInfo(100, 0, new ArrayList<>()), Component.text("Hello world!"), + new PlayerInfo(100, 0, new ArrayList<>()), + new VersionInfo(MinecraftCodec.CODEC.getMinecraftVersion(), MinecraftCodec.CODEC.getProtocolVersion()), null, false ); diff --git a/protocol/src/test/java/org/geysermc/mcprotocollib/protocol/packet/status/clientbound/ClientboundStatusResponsePacketTest.java b/protocol/src/test/java/org/geysermc/mcprotocollib/protocol/packet/status/clientbound/ClientboundStatusResponsePacketTest.java index 004d78299..a211cc340 100644 --- a/protocol/src/test/java/org/geysermc/mcprotocollib/protocol/packet/status/clientbound/ClientboundStatusResponsePacketTest.java +++ b/protocol/src/test/java/org/geysermc/mcprotocollib/protocol/packet/status/clientbound/ClientboundStatusResponsePacketTest.java @@ -18,11 +18,11 @@ public class ClientboundStatusResponsePacketTest extends PacketTest { public void setup() { this.setPackets(new ClientboundStatusResponsePacket( new ServerStatusInfo( - new VersionInfo(MinecraftCodec.CODEC.getMinecraftVersion(), MinecraftCodec.CODEC.getProtocolVersion()), + Component.text("Description"), new PlayerInfo(100, 10, new ArrayList<>( - Collections.singleton(new GameProfile(UUID.randomUUID(), "Username")) + Collections.singleton(new GameProfile(UUID.randomUUID(), "Username")) )), - Component.text("Description"), + new VersionInfo(MinecraftCodec.CODEC.getMinecraftVersion(), MinecraftCodec.CODEC.getProtocolVersion()), null, false )