Class ListeningWhitelist

java.lang.Object
com.comphenix.protocol.events.ListeningWhitelist

public class ListeningWhitelist extends Object
Determines which packets will be observed by a listener, and with what priority.
  • Field Details

    • EMPTY_WHITELIST

      public static final ListeningWhitelist EMPTY_WHITELIST
      A whitelist with no packets - indicates that the listener shouldn't observe any packets.
  • Method Details

    • isEmpty

      public static boolean isEmpty(ListeningWhitelist whitelist)
      Determine if the given whitelist is empty or not.
      Parameters:
      whitelist - - the whitelist to test.
      Returns:
      TRUE if the whitelist is empty, FALSE otherwise.
    • newBuilder

      public static ListeningWhitelist.Builder newBuilder()
      Construct a new builder of whitelists.
      Returns:
      New whitelist builder.
    • newBuilder

      public static ListeningWhitelist.Builder newBuilder(ListeningWhitelist template)
      Construct a new builder of whitelists initialized to the same values as the template.
      Parameters:
      template - - the template object.
      Returns:
      New whitelist builder.
    • isEnabled

      public boolean isEnabled()
      Whether or not this whitelist has any enabled packets.
      Returns:
      TRUE if there are any packets, FALSE otherwise.
    • getPriority

      public ListenerPriority getPriority()
      Retrieve the priority in the execution order of the packet listener. Highest priority will be executed last.
      Returns:
      Execution order in terms of priority.
    • getTypes

      public Set<PacketType> getTypes()
      Retrieves a set of the packets that will be observed by the listeners.
      Returns:
      Packet whitelist.
    • getGamePhase

      public GamePhase getGamePhase()
      Retrieve which game phase this listener is active under.
      Returns:
      The active game phase.
    • getOptions

      public Set<ListenerOptions> getOptions()
      Retrieve every special option associated with this whitelist.
      Returns:
      Every special option.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object