Class TownPreUnclaimCmdEvent

java.lang.Object
org.bukkit.event.Event
com.palmergames.bukkit.towny.event.CancellableTownyEvent
com.palmergames.bukkit.towny.event.town.TownPreUnclaimCmdEvent
All Implemented Interfaces:
org.bukkit.event.Cancellable

public class TownPreUnclaimCmdEvent extends CancellableTownyEvent
An event fired when a '/town unclaim [args]' command is issued, prior to any other calculations.

Useful for plugins (like war systems) wanting halt the command in it's tracks. For an example, see Flag War's FlagWarCustomListener.onWarPreUnclaim().

Not to be confused with TownPreUnclaimEvent, which is handled within the TownyDatabaseHandler.

  • Constructor Details

    • TownPreUnclaimCmdEvent

      public TownPreUnclaimCmdEvent(Town town, Resident resident, TownyWorld world, List<WorldCoord> selection)
      Constructs the TownPreUnclaimCmdEvent and stores data an external war plugin may use.
      Parameters:
      town - The Town about to process un-claiming (a) plot(s).
      resident - The Resident who initiated the command.
      world - The TownyWorld in which the resident is in.
      selection - The List of WorldCoord which will be unclaimed.
  • Method Details

    • getTown

      public Town getTown()
      Returns:
      Gets the Town which would have it's TownBlocks unclaimed.
    • getResident

      public Resident getResident()
      Returns:
      Gets the Resident that issued the '/t unclaim ...' command.
    • getTownyWorld

      public TownyWorld getTownyWorld()
      Returns:
      Gets the TownyWorld where the land is being unclaimed.
    • getUnclaimSelection

      public List<WorldCoord> getUnclaimSelection()
      Returns:
      Gets the List of WorldCoord which will be unclaimed if this event is not cancelled.
    • getHandlerList

      public static org.bukkit.event.HandlerList getHandlerList()
    • getHandlers

      @NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()
      Specified by:
      getHandlers in class org.bukkit.event.Event