Class BukkitScriptEventListener

java.lang.Object
dev.magicmq.pyspigot.bukkit.manager.listener.BukkitScriptEventListener
All Implemented Interfaces:
Listener

public class BukkitScriptEventListener extends Object implements Listener
A dummy Bukkit Listener that holds an event a script is currently listening to.
See Also:
  • Constructor Details

    • BukkitScriptEventListener

      public BukkitScriptEventListener(dev.magicmq.pyspigot.manager.script.Script script, PyFunction listenerFunction, Class<? extends Event> event)
      Parameters:
      script - The script listening to events within this listener
      listenerFunction - The script function that should be called when the event occurs
      event - The Bukkit event associated with this listener. Should be a Class of the Bukkit event
  • Method Details

    • 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 Event> getEvent()
      Get the Bukkit event associated with this listener.

      Note: Because of the way scripts register events, this will be a Class of the Bukkit event, which essentially represents its type.

      Returns:
      The Bukkit event associated with this listener.
    • getEventExecutor

      public BukkitScriptEventExecutor getEventExecutor()
      Get the BukkitScriptEventExecutor associated with this script event listener.
      Returns:
      The BukkitScriptEventExecutor associated with this script event listener
    • toString

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