Class MTVListener

java.lang.Object
nl.mtvehicles.core.infrastructure.models.MTVListener
All Implemented Interfaces:
org.bukkit.event.Listener
Direct Known Subclasses:
ChatListener, InventoryClickListener, InventoryCloseListener, JerryCanClickListener, JoinListener, LeaveListener, VehicleClickListener, VehicleEntityListener, VehicleLeaveListener, VehiclePlaceListener, VehicleVoucherListener

public abstract class MTVListener extends Object implements org.bukkit.event.Listener
Abstract class for the plugin's listeners
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected org.bukkit.event.Event
    The event the listener is listening to
    protected org.bukkit.entity.Player
    Player of this event
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
     
    protected
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
     
    protected void
    callAPI(org.bukkit.entity.Player player)
    Call the event with a custom player
    protected MTVEvent
     
    protected boolean
    Check whether the event has been cancelled via MTVehicles API.
    protected void
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • event

      protected org.bukkit.event.Event event
      The event the listener is listening to
    • player

      @Nullable protected org.bukkit.entity.Player player
      Player of this event
  • Constructor Details

    • MTVListener

      protected MTVListener()
    • MTVListener

      protected MTVListener(MTVEvent api)
  • Method Details

    • isCancelled

      protected boolean isCancelled()
      Check whether the event has been cancelled via MTVehicles API.
      Returns:
      True if event is cancelled
    • setAPI

      protected void setAPI(MTVEvent event)
    • getAPI

      protected MTVEvent getAPI()
    • callAPI

      protected void callAPI()
    • callAPI

      protected void callAPI(@Nullable org.bukkit.entity.Player player) throws NullPointerException
      Call the event with a custom player
      Parameters:
      player - Custom player (may be null if no player is specified)
      Throws:
      NullPointerException - If API is not specified for the listener (see setAPI(MTVEvent))