Class ScriptPacketListener<T>
java.lang.Object
dev.simplix.protocolize.api.listener.AbstractPacketListener<T>
dev.magicmq.pyspigot.bungee.manager.protocol.ScriptPacketListener<T>
- Type Parameters:
T- The packet to listen for
public class ScriptPacketListener<T>
extends dev.simplix.protocolize.api.listener.AbstractPacketListener<T>
A script listener that listens for BungeeCord packets.
-
Constructor Summary
ConstructorsConstructorDescriptionScriptPacketListener(dev.magicmq.pyspigot.manager.script.Script script, PyFunction receiveFunction, PyFunction sendFunction, Class<T> packet, dev.simplix.protocolize.api.Direction direction, int priority) -
Method Summary
Modifier and TypeMethodDescriptiondev.magicmq.pyspigot.manager.script.ScriptGet the script associated with this listener.voidpacketReceive(dev.simplix.protocolize.api.listener.PacketReceiveEvent<T> event) Called internally when the packet is received.voidpacketSend(dev.simplix.protocolize.api.listener.PacketSendEvent<T> event) Called internally when the packet is sent.toString()Prints a representation of this ScriptPacketListener in string format, including the packet type listened to by the listenerMethods inherited from class dev.simplix.protocolize.api.listener.AbstractPacketListener
direction, priority, type
-
Constructor Details
-
ScriptPacketListener
public ScriptPacketListener(dev.magicmq.pyspigot.manager.script.Script script, PyFunction receiveFunction, PyFunction sendFunction, Class<T> packet, dev.simplix.protocolize.api.Direction direction, int priority) - Parameters:
script- The script associated with this packet listenerreceiveFunction- The function to be called when the packet is receivedsendFunction- The function to be called when the packet is sentpacket- The packet to listen fordirection- TheDirectionof the listenerpriority- The priority of the listener
-
-
Method Details
-
packetReceive
Called internally when the packet is received.- Specified by:
packetReceivein classdev.simplix.protocolize.api.listener.AbstractPacketListener<T>- Parameters:
event- The packet receive event
-
packetSend
Called internally when the packet is sent.- Specified by:
packetSendin classdev.simplix.protocolize.api.listener.AbstractPacketListener<T>- Parameters:
event- The packet send event
-
getScript
public dev.magicmq.pyspigot.manager.script.Script getScript()Get the script associated with this listener.- Returns:
- The script associated with this listener
-
toString
Prints a representation of this ScriptPacketListener in string format, including the packet type listened to by the listener
-