Package com.comphenix.protocol.events
Class PacketAdapter.AdapterParameteters
java.lang.Object
com.comphenix.protocol.events.PacketAdapter.AdapterParameteters
- Enclosing class:
PacketAdapter
Represents a builder for passing parameters to the packet adapter constructor.
Note: Never make spelling mistakes in a public API!
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSet this adapter to also look for client-side packets.connectionSide(ConnectionSide connectionSide) Set the packet types this listener is looking for.Set which game phase this listener is active under.listenerPriority(ListenerPriority listenerPriority) Set the the event priority, where the execution is in ascending order from lowest to highest.Set the game phase toGamePhase.LOGIN, allowing ProtocolLib to intercept login packets.Set the listener option toListenerOptions.ASYNC, indicating that our outbound listener is thread safe.options(ListenerOptions... options) Set listener options that decide whether or not to intercept the raw packet data as read from the network stream.options(Set<? extends ListenerOptions> options) Set listener options that decide whether or not to intercept the raw packet data as read from the network stream.Set the listener option toListenerOptions.SYNC, indicating that our inbound listener must be executed on the main server thread.plugin(org.bukkit.plugin.Plugin plugin) Set the plugin that spawned this listener.Set this adapter to also look for server-side packets.types(PacketType... packets) Set the packet types the listener is looking for.types(Set<PacketType> packets) Set the packet types the listener is looking for.
-
Constructor Details
-
AdapterParameteters
public AdapterParameteters()
-
-
Method Details
-
plugin
Set the plugin that spawned this listener. This parameter is required.- Parameters:
plugin- - the plugin.- Returns:
- This builder, for chaining.
-
connectionSide
Set the packet types this listener is looking for. This parameter is required.- Parameters:
connectionSide- - the new packet type.- Returns:
- This builder, for chaining.
-
clientSide
Set this adapter to also look for client-side packets.- Returns:
- This builder, for chaining.
-
serverSide
Set this adapter to also look for server-side packets.- Returns:
- This builder, for chaining.
-
listenerPriority
public PacketAdapter.AdapterParameteters listenerPriority(@Nonnull ListenerPriority listenerPriority) Set the the event priority, where the execution is in ascending order from lowest to highest.Default is
ListenerPriority.NORMAL.- Parameters:
listenerPriority- - the new event priority.- Returns:
- This builder, for chaining.
-
gamePhase
Set which game phase this listener is active under. This is a hint for ProtocolLib to start intercepting login packets.Default is
GamePhase.PLAYING, which will not intercept login packets.- Parameters:
gamePhase- - the new game phase.- Returns:
- This builder, for chaining.
-
loginPhase
Set the game phase toGamePhase.LOGIN, allowing ProtocolLib to intercept login packets.- Returns:
- This builder, for chaining.
-
options
Set listener options that decide whether or not to intercept the raw packet data as read from the network stream.The default is to disable this raw packet interception.
- Parameters:
options- - every option to use.- Returns:
- This builder, for chaining.
-
options
Set listener options that decide whether or not to intercept the raw packet data as read from the network stream.The default is to disable this raw packet interception.
- Parameters:
options- - every option to use.- Returns:
- This builder, for chaining.
-
optionAsync
Set the listener option toListenerOptions.ASYNC, indicating that our outbound listener is thread safe.This allows ProtocolLib to perform certain optimizations.
- Returns:
- This builder, for chaining.
-
optionSync
Set the listener option toListenerOptions.SYNC, indicating that our inbound listener must be executed on the main server thread.- Returns:
- This builder, for chaining.
-
types
Set the packet types the listener is looking for.This parameter is required.
- Parameters:
packets- - the packet types to look for.- Returns:
- This builder, for chaining.
-
types
Set the packet types the listener is looking for.This parameter is required.
- Parameters:
packets- - a set of packet types to look for.- Returns:
- This builder, for chaining.
-