Class BungeeScriptEventListener
java.lang.Object
dev.magicmq.pyspigot.bungee.manager.listener.BungeeScriptEventListener
- All Implemented Interfaces:
net.md_5.bungee.api.plugin.Listener
public class BungeeScriptEventListener
extends Object
implements net.md_5.bungee.api.plugin.Listener
A dummy BungeeCord Listener that holds an event a script is currently listening to.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionBungeeScriptEventListener(dev.magicmq.pyspigot.manager.script.Script script, PyFunction listenerFunction, Class<? extends net.md_5.bungee.api.plugin.Event> event, byte priority) -
Method Summary
Modifier and TypeMethodDescriptionvoidcallToScript(Object event) Called internally when the event occurs.Class<? extends net.md_5.bungee.api.plugin.Event> getEvent()Get the BungeeCord event associated with this listener.Get the script function that should be called when the event occurs.byteGet the priority of this listener.dev.magicmq.pyspigot.manager.script.ScriptGet the script associated with this listener.toString()Prints a representation of this BungeeScriptEventListener in string format, including the event being listened to by the listener
-
Constructor Details
-
BungeeScriptEventListener
public BungeeScriptEventListener(dev.magicmq.pyspigot.manager.script.Script script, PyFunction listenerFunction, Class<? extends net.md_5.bungee.api.plugin.Event> event, byte priority) - Parameters:
script- The script listening to events within this listenerlistenerFunction- The script function that should be called when the event occursevent- The BungeeCord event associated with this listener. Should be aClassof the BungeeCord eventpriority- The priority of this event listener
-
-
Method Details
-
callToScript
Called internally when the event occurs.- Parameters:
event- The event that occurred
-
getScript
public dev.magicmq.pyspigot.manager.script.Script getScript()Get the script associated with this listener.- Returns:
- The script associated with this listener
-
getListenerFunction
Get the script function that should be called when the event occurs.- Returns:
- The script function that should be called when the event occurs
-
getEvent
Get the BungeeCord event associated with this listener.Note: Because of the way scripts register events, this will be a
Classof the BungeeCord event, which essentially represents its type.- Returns:
- The Bukkit event associated with this listener
-
getPriority
public byte getPriority()Get the priority of this listener.- Returns:
- The priority of this listener
-
toString
Prints a representation of this BungeeScriptEventListener in string format, including the event being listened to by the listener
-