public class SpigotPacketInjector
extends java.lang.Object
Constructor and Description |
---|
SpigotPacketInjector(java.lang.ClassLoader classLoader,
ErrorReporter reporter,
ListenerInvoker invoker,
Server server)
Create a new spigot injector.
|
Modifier and Type | Method and Description |
---|---|
static boolean |
canUseSpigotListener()
Determine if there is a Spigot packet listener.
|
PacketInjector |
getPacketInjector()
Retrieve the dummy packet injection handler.
|
PlayerInjectionHandler |
getPlayerHandler()
Retrieve the dummy player injection handler.
|
boolean |
hasRegistered()
Determine if the Spigot packet listener has been registered.
|
java.lang.Object |
packetQueued(java.lang.Object networkManager,
java.lang.Object connection,
java.lang.Object packet)
Called when a packet is queued to be sent.
|
java.lang.Object |
packetReceived(java.lang.Object networkManager,
java.lang.Object connection,
java.lang.Object packet)
Called when a packet has been received and is about to be handled by the
current Connection.
|
boolean |
register(Plugin plugin)
Register the Spigot packet injector.
|
public SpigotPacketInjector(java.lang.ClassLoader classLoader, ErrorReporter reporter, ListenerInvoker invoker, Server server)
public static boolean canUseSpigotListener()
public boolean register(Plugin plugin)
plugin
- - the parent plugin.public boolean hasRegistered()
public PlayerInjectionHandler getPlayerHandler()
public PacketInjector getPacketInjector()
public java.lang.Object packetReceived(java.lang.Object networkManager, java.lang.Object connection, java.lang.Object packet)
The returned packet will be the packet passed on for handling, or in the case of null being returned, not handled at all.
networkManager
- - the NetworkManager receiving the packetconnection
- - the connection which will handle the packetpacket
- - the received packetpublic java.lang.Object packetQueued(java.lang.Object networkManager, java.lang.Object connection, java.lang.Object packet)
The returned packet will be the packet sent. In the case of null being returned, the packet will not be sent.
networkManager
- - the NetworkManager which will send the packetconnection
- - the connection which queued the packetpacket
- - the queue packet