Class TownyActionEvent

java.lang.Object
org.bukkit.event.Event
com.palmergames.bukkit.towny.event.CancellableTownyEvent
com.palmergames.bukkit.towny.event.actions.TownyActionEvent
All Implemented Interfaces:
org.bukkit.event.Cancellable
Direct Known Subclasses:
TownyBuildEvent, TownyDestroyEvent, TownyItemuseEvent, TownySwitchEvent

public abstract class TownyActionEvent extends CancellableTownyEvent
Used by the TownyBuildEvent, TownyDestroyEvent, TownySwitchEvent and TownyItemuseEvent. Part of the API which lets Towny's war and other plugins modify Towny's plot-permission-decision outcomes.
Author:
LlmDl
  • Field Details

    • player

      protected final org.bukkit.entity.Player player
    • loc

      protected final org.bukkit.Location loc
    • mat

      protected final org.bukkit.Material mat
    • townblock

      protected final TownBlock townblock
  • Constructor Details

    • TownyActionEvent

      public TownyActionEvent(org.bukkit.entity.Player player, org.bukkit.Location loc, org.bukkit.Material mat, TownBlock townblock, boolean cancelled)
  • Method Details

    • isMessageSuppressed

      public boolean isMessageSuppressed()
    • suppressMessage

      public void suppressMessage()
    • getMaterial

      public org.bukkit.Material getMaterial()
      Returns:
      Material of the block being built.
    • getLocation

      public org.bukkit.Location getLocation()
      Returns:
      Location of the block being built.
    • getPlayer

      public org.bukkit.entity.Player getPlayer()
      Returns:
      player involved in the build event.
    • getTownBlock

      @Nullable public @Nullable TownBlock getTownBlock()
      The TownBlock this action occured in, or null if in the wilderness.
      Returns:
      TownBlock or null.
    • isInWilderness

      public boolean isInWilderness()
      Did this action occur in the wilderness?
      Returns:
      return true if this was in the wilderness.
    • hasTownBlock

      public boolean hasTownBlock()
      Did this action occur inside of a town's townblock?
      Returns:
      true if this has a townblock.