Package com.comphenix.protocol.events
Class MonitorAdapter
java.lang.Object
com.comphenix.protocol.events.MonitorAdapter
- All Implemented Interfaces:
PacketListener
Represents a listener that is notified of every sent and received packet.
-
Constructor Summary
ConstructorsConstructorDescriptionMonitorAdapter(org.bukkit.plugin.Plugin plugin, ConnectionSide side) MonitorAdapter(org.bukkit.plugin.Plugin plugin, ConnectionSide side, Logger logger) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionorg.bukkit.plugin.PluginRetrieve the plugin that created list packet listener.Retrieve which packets sent by the client this listener will observe.Retrieve which packets sent by the server this listener will observe.voidonPacketReceiving(PacketEvent event) Invoked right before a received packet from a client is being processed.voidonPacketSending(PacketEvent event) Invoked right before a packet is transmitted from the server to the client.
-
Constructor Details
-
MonitorAdapter
-
MonitorAdapter
@Deprecated public MonitorAdapter(org.bukkit.plugin.Plugin plugin, ConnectionSide side, Logger logger) Deprecated.
-
-
Method Details
-
getSendingWhitelist
Description copied from interface:PacketListenerRetrieve which packets sent by the server this listener will observe.- Specified by:
getSendingWhitelistin interfacePacketListener- Returns:
- List of server packets to observe, along with the priority.
-
getReceivingWhitelist
Description copied from interface:PacketListenerRetrieve which packets sent by the client this listener will observe.- Specified by:
getReceivingWhitelistin interfacePacketListener- Returns:
- List of server packets to observe, along with the priority.
-
getPlugin
public org.bukkit.plugin.Plugin getPlugin()Description copied from interface:PacketListenerRetrieve the plugin that created list packet listener.- Specified by:
getPluginin interfacePacketListener- Returns:
- The plugin, or NULL if not available.
-
onPacketSending
Description copied from interface:PacketListenerInvoked right before a packet is transmitted from the server to the client.Note that the packet may be replaced, if needed.
This method is executed on the main server thread by default. However, some spigot forks (like paper) schedule specific packets off the main thread. If the
ListenerOptions.ASYNCoption is not specified any invocation of this method will be on the main server thread.- Specified by:
onPacketSendingin interfacePacketListener- Parameters:
event- - the packet that should be sent.
-
onPacketReceiving
Description copied from interface:PacketListenerInvoked right before a received packet from a client is being processed.This method will be called asynchronously (or on the netty event loop) by default. If the
ListenerOptions.SYNCoption is specified, the invocation of this method will be synced to the main server thread which might cause issues due to delayed packets.- Specified by:
onPacketReceivingin interfacePacketListener- Parameters:
event- - the packet that has been received.
-