Class ServerListPingEvent

  • All Implemented Interfaces:
    Iterable<Player>

    public class ServerListPingEvent
    extends ServerEvent
    implements Iterable<Player>
    Called when a server list ping is coming in. Displayed players can be checked and removed by iterating over this event.
    • Constructor Detail

      • ServerListPingEvent

        public ServerListPingEvent​(@NotNull
                                   InetAddress address,
                                   @NotNull
                                   String motd,
                                   int numPlayers,
                                   int maxPlayers)
      • ServerListPingEvent

        protected ServerListPingEvent​(@NotNull
                                      InetAddress address,
                                      @NotNull
                                      String motd,
                                      int maxPlayers)
        This constructor is intended for implementations that provide the iterator() method, thus provided the getNumPlayers() count.
        Parameters:
        address - the address of the pinger
        motd - the message of the day
        maxPlayers - the max number of players
    • Method Detail

      • getAddress

        @NotNull
        public InetAddress getAddress()
        Get the address the ping is coming from.
        Returns:
        the address
      • getMotd

        @NotNull
        public String getMotd()
        Get the message of the day message.
        Returns:
        the message of the day
      • setMotd

        public void setMotd​(@NotNull
                            String motd)
        Change the message of the day message.
        Parameters:
        motd - the message of the day
      • getNumPlayers

        public int getNumPlayers()
        Get the number of players sent.
        Returns:
        the number of players
      • getMaxPlayers

        public int getMaxPlayers()
        Get the maximum number of players sent.
        Returns:
        the maximum number of players
      • setMaxPlayers

        public void setMaxPlayers​(int maxPlayers)
        Set the maximum number of players sent.
        Parameters:
        maxPlayers - the maximum number of player
      • getHandlerList

        @NotNull
        public static HandlerList getHandlerList()