Class FlagRegisterEvent

java.lang.Object
org.bukkit.event.Event
cn.lunadeer.dominion.events.CallableEvent
cn.lunadeer.dominion.events.FlagRegisterEvent
All Implemented Interfaces:
org.bukkit.event.Cancellable

public class FlagRegisterEvent extends CallableEvent implements org.bukkit.event.Cancellable
Fired before a custom flag is registered.

Listeners may replace the flag with setFlag(Flag) or cancel the event to reject registration.

  • Nested Class Summary

    Nested classes/interfaces inherited from class org.bukkit.event.Event

    org.bukkit.event.Event.Result
  • Constructor Summary

    Constructors
    Constructor
    Description
    FlagRegisterEvent(org.bukkit.plugin.java.JavaPlugin plugin, Flag flag)
    Creates a flag registration event.
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets the flag currently proposed for registration.
    org.bukkit.plugin.java.JavaPlugin
    Gets the plugin requesting registration.
    boolean
    Checks whether registration has been cancelled.
    void
    setCancelled(boolean cancel)
    Sets whether registration is cancelled.
    void
    setFlag(Flag flag)
    Replaces the flag proposed for registration.

    Methods inherited from class cn.lunadeer.dominion.events.CallableEvent

    call, getHandlerList, getHandlers

    Methods inherited from class org.bukkit.event.Event

    callEvent, getEventName, isAsynchronous

    Methods inherited from class java.lang.Object

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

    • FlagRegisterEvent

      public FlagRegisterEvent(org.bukkit.plugin.java.JavaPlugin plugin, Flag flag)
      Creates a flag registration event.
      Parameters:
      plugin - the plugin requesting registration
      flag - the flag proposed for registration
  • Method Details

    • getPlugin

      public org.bukkit.plugin.java.JavaPlugin getPlugin()
      Gets the plugin requesting registration.
      Returns:
      the requesting plugin
    • getFlag

      public Flag getFlag()
      Gets the flag currently proposed for registration.
      Returns:
      the proposed flag
    • setFlag

      public void setFlag(Flag flag)
      Replaces the flag proposed for registration.
      Parameters:
      flag - the replacement flag
    • isCancelled

      public boolean isCancelled()
      Checks whether registration has been cancelled.
      Specified by:
      isCancelled in interface org.bukkit.event.Cancellable
      Returns:
      true when the flag must not be registered
    • setCancelled

      public void setCancelled(boolean cancel)
      Sets whether registration is cancelled.
      Specified by:
      setCancelled in interface org.bukkit.event.Cancellable
      Parameters:
      cancel - true to reject registration