Package com.comphenix.protocol.events
Interface PacketOutputHandler
- All Known Implementing Classes:
PacketOutputAdapter
public interface PacketOutputHandler
Represents a custom packet serializer onto the network stream.
-
Method Summary
Modifier and TypeMethodDescriptionorg.bukkit.plugin.PluginThe plugin that owns this output handler.Retrieve the priority that decides the order each network handler is allowed to manipulate the output buffer.byte[]handle(PacketEvent event, byte[] buffer) Invoked when a given packet is to be written to the output stream.
-
Method Details
-
getPriority
ListenerPriority getPriority()Retrieve the priority that decides the order each network handler is allowed to manipulate the output buffer.Higher priority is executed before lower.
- Returns:
- The handler priority.
-
getPlugin
org.bukkit.plugin.Plugin getPlugin()The plugin that owns this output handler.- Returns:
- The owner plugin.
-
handle
Invoked when a given packet is to be written to the output stream.Note that the buffer is initially filled with the output from the default write method.
In Minecraft 1.6.4, the header is always excluded, whereas it MUST be included in Minecraft 1.7.2. Call NetworkMarker#requireOutputHeader() to determine this.
- Parameters:
event- - the packet that will be outputted.buffer- - the data that is currently scheduled to be outputted.- Returns:
- The modified byte array to write. NULL is not permitted.
-