Class TownyExplodingBlocksEvent

java.lang.Object
org.bukkit.event.Event
com.palmergames.bukkit.towny.event.actions.TownyExplodingBlocksEvent

public class TownyExplodingBlocksEvent extends org.bukkit.event.Event
Part of the API which lets Towny's war and other plugins modify Towny's plot-permission-decision outcomes. TownyExplodingBlockEvents are thrown when an explosion occurs in a Towny world, causing block damage.
- When a bed/respawn anchor explodes causing block damage.
- When a an entity explodes causing block damage.
Author:
LlmDl
  • Nested Class Summary Link icon

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

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

    Constructors
    Constructor
    Description
    TownyExplodingBlocksEvent(List<org.bukkit.block.Block> vanillaBlockList, List<org.bukkit.block.Block> townyFilteredList, org.bukkit.Material mat, org.bukkit.entity.Entity entity, org.bukkit.event.Event bukkitExplodeEvent)
    Event thrown when blocks are exploded by a block or entity.
  • Method Summary Link icon

    Modifier and Type
    Method
    Description
    @Nullable List<org.bukkit.block.Block>
    The block list that will ultimately be used to set which blocks are allowed, as long as setBlockList() has been used by someone.
    org.bukkit.event.Event
    Returns the bukkit event which originally fired when the explosion happened.
    @Nullable org.bukkit.entity.Entity
    Returns the entity causing the entity explosion.
    static org.bukkit.event.HandlerList
     
    org.bukkit.event.HandlerList
     
    @Nullable org.bukkit.Material
    Returns the material causing the block explosion.
    final @Nullable List<org.bukkit.block.Block>
    The list of already-filtered blocks Towny has determined will be allowed to explode.
    final List<org.bukkit.block.Block>
    The blocklist of blocks exploding because of the explosion event that triggered this event.
    boolean
    Whether this event has a entity.
    boolean
    Whether this event has a material.
    boolean
    Has any plugin or Towny's WarZoneListener modified the list of blocks to explode?
    void
    setBlockList(List<org.bukkit.block.Block> blockList)
    Used to set the list of Blocks which will be allowed to explode by Towny.

    Methods inherited from class org.bukkit.event.Event Link icon

    getEventName, isAsynchronous

    Methods inherited from class java.lang.Object Link icon

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

    • TownyExplodingBlocksEvent Link icon

      public TownyExplodingBlocksEvent(List<org.bukkit.block.Block> vanillaBlockList, List<org.bukkit.block.Block> townyFilteredList, org.bukkit.Material mat, org.bukkit.entity.Entity entity, org.bukkit.event.Event bukkitExplodeEvent)
      Event thrown when blocks are exploded by a block or entity.
      Parameters:
      vanillaBlockList - - List of Blocks which were involved in the original explosion.
      townyFilteredList - - List of Blocks Towny has already filtered, these blocks will explode unless setBlockList(List) is used.
      mat - - Material which caused the block explosion or null if it is an entity explosion.
      entity - - Entity which caused the entity explosion or null if it is a block explosion.
      bukkitExplodeEvent - - The Bukkit Explosion Event that caused this explosion.
  • Method Details Link icon

    • getHandlerList Link icon

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

      public org.bukkit.event.HandlerList getHandlers()
      Specified by:
      getHandlers in class org.bukkit.event.Event
    • setBlockList Link icon

      public void setBlockList(List<org.bukkit.block.Block> blockList)
      Used to set the list of Blocks which will be allowed to explode by Towny.
      Parameters:
      blockList - - List of Blocks which will explode.
    • getBlockList Link icon

      @Nullable public @Nullable List<org.bukkit.block.Block> getBlockList()
      The block list that will ultimately be used to set which blocks are allowed, as long as setBlockList() has been used by someone.
      Returns:
      blockList - List of blocks which will be used by Towny ultimately.
    • getVanillaBlockList Link icon

      public final List<org.bukkit.block.Block> getVanillaBlockList()
      The blocklist of blocks exploding because of the explosion event that triggered this event.
      Returns:
      vanillaBlockList - The total number of blocks in this explosion.
    • getTownyFilteredBlockList Link icon

      @Nullable public final @Nullable List<org.bukkit.block.Block> getTownyFilteredBlockList()
      The list of already-filtered blocks Towny has determined will be allowed to explode.
      Returns:
      filteredBlockList - Already allowed blocks.
    • isChanged Link icon

      public boolean isChanged()
      Has any plugin or Towny's WarZoneListener modified the list of blocks to explode?
      Returns:
      true if the list has been altered.
    • hasMaterial Link icon

      public boolean hasMaterial()
      Whether this event has a material.
      Returns:
      true if this was a block explosion.
    • getMaterial Link icon

      @Nullable public @Nullable org.bukkit.Material getMaterial()
      Returns the material causing the block explosion.
      Returns:
      material responsible for explosion or null if it is a entity explosion.
    • hasEntity Link icon

      public boolean hasEntity()
      Whether this event has a entity.
      Returns:
      true is this was an entity explosion.
    • getEntity Link icon

      @Nullable public @Nullable org.bukkit.entity.Entity getEntity()
      Returns the entity causing the entity explosion.
      Returns:
      entity responsible for explosion or null if it is a block explosion.
    • getBukkitExplodeEvent Link icon

      public org.bukkit.event.Event getBukkitExplodeEvent()
      Returns the bukkit event which originally fired when the explosion happened.
      Returns:
      event which can be either an EntityExplodeEvent or a BlockExplodeEvent.