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:
  • Listener
  • Constructor Summary

    Constructors
    Constructor
    Description
    BungeeScriptEventListener(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 Type
    Method
    Description
    void
    Called internally when the event occurs.
    Class<? extends net.md_5.bungee.api.plugin.Event>
    Get the BungeeCord event associated with this listener.
    Get the script function that should be called when the event occurs.
    byte
    Get the priority of this listener.
    dev.magicmq.pyspigot.manager.script.Script
    Get the script associated with this listener.
    Prints a representation of this BungeeScriptEventListener in string format, including the event being listened to by the listener

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • 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 listener
      listenerFunction - The script function that should be called when the event occurs
      event - The BungeeCord event associated with this listener. Should be a Class of the BungeeCord event
      priority - The priority of this event listener
  • Method Details

    • callToScript

      public void callToScript(Object event)
      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

      public PyFunction 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

      public Class<? extends net.md_5.bungee.api.plugin.Event> getEvent()
      Get the BungeeCord event associated with this listener.

      Note: Because of the way scripts register events, this will be a Class of 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

      public String toString()
      Prints a representation of this BungeeScriptEventListener in string format, including the event being listened to by the listener
      Overrides:
      toString in class Object
      Returns:
      A string representation of the ScriptEventListener