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.
- When a bed/respawn anchor explodes causing block damage.
- When a an entity explodes causing block damage.
- Author:
- LlmDl
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result
-
Constructor Summary
ConstructorDescriptionTownyExplodingBlocksEvent
(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
Modifier and TypeMethodDescription@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
getEventName, isAsynchronous
-
Constructor Details
-
TownyExplodingBlocksEvent
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 unlesssetBlockList(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
-
getHandlerList
public static org.bukkit.event.HandlerList getHandlerList() -
getHandlers
public org.bukkit.event.HandlerList getHandlers()- Specified by:
getHandlers
in classorg.bukkit.event.Event
-
setBlockList
Used to set the list of Blocks which will be allowed to explode by Towny.- Parameters:
blockList
- - List of Blocks which will explode.
-
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
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
The list of already-filtered blocks Towny has determined will be allowed to explode.- Returns:
- filteredBlockList - Already allowed blocks.
-
isChanged
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
public boolean hasMaterial()Whether this event has a material.- Returns:
- true if this was a block explosion.
-
getMaterial
@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
public boolean hasEntity()Whether this event has a entity.- Returns:
- true is this was an entity explosion.
-
getEntity
@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
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.
-