@@ -0,0 +1,3456 @@
+package net.tridentsdk.event.server;%0A%0Aimport java.net.InetSocketAddress;%0Aimport java.util.UUID;%0Aimport lombok.AllArgsConstructor;%0Aimport lombok.Data;%0Aimport lombok.Getter;%0Aimport lombok.NonNull;%0Aimport lombok.experimental.Accessors;%0Aimport net.tridentsdk.event.Event;%0Aimport net.tridentsdk.ui.chat.ChatComponent;%0Aimport org.hjson.JsonArray;%0Aimport org.hjson.JsonObject;%0A%0A/**%0A * @author Nick Robson%0A */%0A@Getter%0A@AllArgsConstructor%0Apublic class ServerPingEvent implements Event %7B%0A%0A    private final InetSocketAddress pinger;%0A    private final ServerPingResponse response;%0A%0A    @Data%0A    @AllArgsConstructor%0A    @Accessors(chain = true)%0A    public static class ServerPingResponse %7B%0A%0A        @NonNull%0A        private ServerPingResponseVersion version;%0A%0A        @NonNull%0A        private ServerPingResponsePlayers players;%0A%0A        @NonNull%0A        private ChatComponent description;%0A        private String serverIconBase64;%0A%0A        public JsonObject asJson() %7B%0A            JsonObject json = new JsonObject();%0A            json.add(%22version%22, version.asJson());%0A            json.add(%22players%22, players.asJson());%0A            json.add(%22description%22, description.asJson());%0A            if (serverIconBase64 != null) %7B%0A                json.add(%22favicon%22, serverIconBase64);%0A            %7D%0A            return json;%0A        %7D%0A%0A    %7D%0A%0A    @Data%0A    @AllArgsConstructor%0A    @Accessors(chain = true)%0A    public static class ServerPingResponseVersion %7B%0A%0A        @NonNull%0A        private String name;%0A%0A        @NonNull%0A        private int protocol;%0A%0A        public JsonObject asJson() %7B%0A            JsonObject json = new JsonObject();%0A            json.add(%22name%22, name);%0A            json.add(%22protocol%22, protocol);%0A            return json;%0A        %7D%0A%0A    %7D%0A%0A    @Data%0A    @AllArgsConstructor%0A    @Accessors(chain = true)%0A    public static class ServerPingResponsePlayers %7B%0A%0A        private int onlinePlayers;%0A        private int maxPlayers;%0A%0A        @NonNull%0A        private ServerPingResponseSample%5B%5D samples;%0A%0A        public ServerPingResponsePlayers setOnlinePlayers(int onlinePlayers) %7B%0A            if (onlinePlayers %3C 0)%0A                throw new IllegalArgumentException(%22invalid number of players%22);%0A            this.onlinePlayers = onlinePlayers;%0A            return this;%0A        %7D%0A%0A        public ServerPingResponsePlayers setMaxPlayers(int maxPlayers) %7B%0A            if (maxPlayers %3C 0)%0A                throw new IllegalArgumentException(%22invalid number of players%22);%0A            this.maxPlayers = maxPlayers;%0A            return this;%0A        %7D%0A%0A        public JsonObject asJson() %7B%0A            JsonObject json = new JsonObject();%0A            json.add(%22max%22, maxPlayers);%0A            json.add(%22online%22, onlinePlayers);%0A            JsonArray sampleArray = new JsonArray();%0A            for (ServerPingResponseSample sample : samples) %7B%0A                if (sample != null) %7B%0A                    sampleArray.add(sample.asJson());%0A                %7D%0A            %7D%0A            json.add(%22sample%22, sampleArray);%0A            return json;%0A        %7D%0A%0A    %7D%0A%0A    @Data%0A    @AllArgsConstructor%0A    @Accessors(chain = true)%0A    public static class ServerPingResponseSample %7B%0A%0A        @NonNull%0A        private String name;%0A%0A        @NonNull%0A        private UUID uuid;%0A%0A        public JsonObject asJson() %7B%0A            JsonObject json = new JsonObject();%0A            json.add(%22name%22, name);%0A            json.add(%22id%22, uuid.toString());%0A            return json;%0A        %7D%0A%0A    %7D%0A%0A%7D%0A

Add ServerPingEvent