Package com.comphenix.protocol.events
Class ListeningWhitelist
java.lang.Object
com.comphenix.protocol.events.ListeningWhitelist
Determines which packets will be observed by a listener, and with what priority.
- Author:
- Kristian
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classRepresents a builder of whitelists. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic ListeningWhitelistA whitelist with no packets - indicates that the listener shouldn't observe any packets. -
Method Summary
Modifier and TypeMethodDescriptionbooleanRetrieve which game phase this listener is active under.Retrieve every special option associated with this whitelist.Retrieve the priority in the execution order of the packet listener.getTypes()Retrieves a set of the packets that will be observed by the listeners.inthashCode()static booleanisEmpty(ListeningWhitelist whitelist)Determine if the given whitelist is empty or not.booleanWhether or not this whitelist has any enabled packets.static ListeningWhitelist.BuilderConstruct a new builder of whitelists.static ListeningWhitelist.BuildernewBuilder(ListeningWhitelist template)Construct a new builder of whitelists initialized to the same values as the template.toString()
-
Field Details
-
EMPTY_WHITELIST
A whitelist with no packets - indicates that the listener shouldn't observe any packets.
-
-
Method Details
-
isEnabled
public boolean isEnabled()Whether or not this whitelist has any enabled packets.- Returns:
- TRUE if there are any packets, FALSE otherwise.
-
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
Retrieves a set of the packets that will be observed by the listeners.- Returns:
- Packet whitelist.
-
getGamePhase
Retrieve which game phase this listener is active under.- Returns:
- The active game phase.
-
getOptions
Retrieve every special option associated with this whitelist.- Returns:
- Every special option.
-
hashCode
public int hashCode() -
isEmpty
Determine if the given whitelist is empty or not.- Parameters:
whitelist- - the whitelist to test.- Returns:
- TRUE if the whitelist is empty, FALSE otherwise.
-
equals
-
toString
-
newBuilder
Construct a new builder of whitelists.- Returns:
- New whitelist builder.
-
newBuilder
Construct a new builder of whitelists initialized to the same values as the template.- Parameters:
template- - the template object.- Returns:
- New whitelist builder.
-