Class TEBlockExplodeEvent

java.lang.Object
org.bukkit.event.Event
org.bukkit.event.block.BlockEvent
com.vk2gpz.tokenenchant.event.TEBlockExplodeEvent
All Implemented Interfaces:
org.bukkit.event.Cancellable

public class TEBlockExplodeEvent extends org.bukkit.event.block.BlockEvent implements org.bukkit.event.Cancellable
Called when TokenEnchant's explosive-type enchatnment is initiated.

If none of plugins processes the exploded block and turn them into AIR block, This explosion will not yield anything. By default, TokenEnchant does provide the default pickup function, which will auto pickup the exploded blocks and turn them into AIR. However, if you have your own auto pickup plugin such as VKAutoPickup, AutoSell, you should just let one autopickup plugin to process this event.

  • Nested Class Summary

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

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

    Fields
    Modifier and Type
    Field
    Description
    static int
    A number of blocks processed at a time.

    Fields inherited from class org.bukkit.event.block.BlockEvent

    block
  • Constructor Summary

    Constructors
    Constructor
    Description
    TEBlockExplodeEvent(org.bukkit.entity.Player player, org.bukkit.block.Block what, List<org.bukkit.block.Block> blocks, float yield)
    Constructor
    TEBlockExplodeEvent(org.bukkit.entity.Player player, org.bukkit.block.Block what, List<org.bukkit.block.Block> blocks, float yield, String trigger)
    Constructor
    TEBlockExplodeEvent(org.bukkit.entity.Player player, org.bukkit.block.Block what, List<org.bukkit.block.Block> blocks, float yield, String trigger, Collection<org.bukkit.inventory.ItemStack> drops)
    Constructor
    TEBlockExplodeEvent(org.bukkit.entity.Player player, org.bukkit.block.Block what, List<org.bukkit.block.Block> blocks, float yield, String trigger, Collection<org.bukkit.inventory.ItemStack> drops, int expToDrop)
    Constructor
    TEBlockExplodeEvent(org.bukkit.entity.Player player, org.bukkit.block.Block what, List<org.bukkit.block.Block> blocks, float yield, String trigger, Collection<org.bukkit.inventory.ItemStack> drops, int expToDrop, Object region)
    Constructor
    TEBlockExplodeEvent(org.bukkit.entity.Player player, org.bukkit.block.Block what, List<org.bukkit.block.Block> blocks, float yield, org.bukkit.inventory.ItemStack item)
    Constructor
    TEBlockExplodeEvent(org.bukkit.entity.Player player, org.bukkit.block.Block what, List<org.bukkit.block.Block> blocks, float yield, org.bukkit.inventory.ItemStack item, String trigger)
    Constructor
    TEBlockExplodeEvent(org.bukkit.entity.Player player, org.bukkit.block.Block what, List<org.bukkit.block.Block> blocks, float yield, org.bukkit.inventory.ItemStack item, List<org.bukkit.Material> exemptions)
    Constructor
    TEBlockExplodeEvent(org.bukkit.entity.Player player, org.bukkit.block.Block what, List<org.bukkit.block.Block> blocks, float yield, org.bukkit.inventory.ItemStack item, List<org.bukkit.Material> exemptions, String trigger)
     
    TEBlockExplodeEvent(org.bukkit.entity.Player player, org.bukkit.block.Block what, List<org.bukkit.block.Block> blocks, float yield, org.bukkit.inventory.ItemStack item, List<org.bukkit.Material> exemptions, String trigger, Collection<org.bukkit.inventory.ItemStack> drops)
    Constructor
    TEBlockExplodeEvent(org.bukkit.entity.Player player, org.bukkit.block.Block what, List<org.bukkit.block.Block> blocks, float yield, org.bukkit.inventory.ItemStack item, List<org.bukkit.Material> exemptions, String trigger, Collection<org.bukkit.inventory.ItemStack> drops, int expToDrop)
    Constructor
    TEBlockExplodeEvent(org.bukkit.entity.Player player, org.bukkit.block.Block what, List<org.bukkit.block.Block> blocks, float yield, org.bukkit.inventory.ItemStack item, List<org.bukkit.Material> exemptions, String trigger, Collection<org.bukkit.inventory.ItemStack> drops, int expToDrop, Object region)
    Constructor
  • Method Summary

    Modifier and Type
    Method
    Description
    List<org.bukkit.block.Block>
    Returns a list of blocks flagged as "to be exploded".
    static void
     
    static void
    breakExplodedBlocks(List<org.bukkit.block.Block> blocks)
    Deprecated.
    static void
     
    static void
    clearExplodedBlocks(TEBlockExplodeEvent e, boolean useWorldEdit)
     
    static void
    clearExplodedBlocks(List<org.bukkit.block.Block> blocks)
    Deprecated.
    static int
    Returns the number of exploded blocks to be processed at the time.
    Collection<org.bukkit.inventory.ItemStack>
    Returns a list of ItemStack object to be dropped.
    static Collection<org.bukkit.inventory.ItemStack>
    getDrops(org.bukkit.block.Block block)
    Returns a list of items which would drop by destroying this block
    static Collection<org.bukkit.inventory.ItemStack>
    getDrops(org.bukkit.block.Block block, org.bukkit.inventory.ItemStack tool)
    a list of dropped items for this type of block
    List<org.bukkit.Material>
    Returns a list of materials which are exempt from explosion.
    int
    Returns the amount of Exp to be dropped.
    static org.bukkit.event.HandlerList
     
    @NotNull org.bukkit.event.HandlerList
     
    org.bukkit.inventory.ItemStack
    Returns an itemstack object associated with this explosion.
    org.bukkit.entity.Player
    Returns a player who initiated this explosion.
    Returns the object representing the exploded region.
    Returns a name of Enchantment (from TokenEnchant) which triggered this explosion
    float
    Returns a yielding multiplier.
    boolean
     
    static void
    sets the number of exploded blocks to be processed at the time.
    void
    setCancelled(boolean cancel)
     
    void
    setPlayer(org.bukkit.entity.Player player)
    Sets the player who initiated this event.
    void
    setYield(float yield)
    Sets a specified yielding multiplier.
    static boolean
    shouldDrop(org.bukkit.block.Block b)
     

    Methods inherited from class org.bukkit.event.block.BlockEvent

    getBlock

    Methods inherited from class org.bukkit.event.Event

    getEventName, isAsynchronous

    Methods inherited from class java.lang.Object

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

    • BLOCKS_PER_PROCESS

      public static int BLOCKS_PER_PROCESS
      A number of blocks processed at a time. Some plugins and custom enchants, which know how to process this event would utilise this value to process exploded block in group to avoid hogging the processing time.
  • Constructor Details

    • TEBlockExplodeEvent

      public TEBlockExplodeEvent(org.bukkit.entity.Player player, org.bukkit.block.Block what, List<org.bukkit.block.Block> blocks, float yield, org.bukkit.inventory.ItemStack item, List<org.bukkit.Material> exemptions, String trigger, Collection<org.bukkit.inventory.ItemStack> drops, int expToDrop, Object region)
      Constructor
      Parameters:
      player - The player who triggered TokenEnchant explosion
      what - The original block broken that triggered the explosion.
      blocks - A list of "to be exploded" blocks.
      yield - A multiplier (currently not used)
      item - An item a player was holding.
      exemptions - A list of materials, should be exempt from explosion.
      trigger - A name of the Enchantment that triggered this event.
      drops - A list of ItemStack to be dropped.
      expToDrop - EXP value to be dropped.
      region - An object representing the exploded region. (Typically a WorldEdit selection object)
    • TEBlockExplodeEvent

      public TEBlockExplodeEvent(org.bukkit.entity.Player player, org.bukkit.block.Block what, List<org.bukkit.block.Block> blocks, float yield, org.bukkit.inventory.ItemStack item, List<org.bukkit.Material> exemptions, String trigger, Collection<org.bukkit.inventory.ItemStack> drops, int expToDrop)
      Constructor
      Parameters:
      player - The player who triggered TokenEnchant explosion
      what - The original block broken that triggered the explosion.
      blocks - A list of "to be exploded" blocks.
      yield - A multiplier (currently not used)
      item - An item a player was holding.
      exemptions - A list of materials, should be exempt from explosion.
      trigger - A name of the Enchantment that triggered this event.
      drops - A list of ItemStack to be dropped.
      expToDrop - EXP value to be dropped.
    • TEBlockExplodeEvent

      public TEBlockExplodeEvent(org.bukkit.entity.Player player, org.bukkit.block.Block what, List<org.bukkit.block.Block> blocks, float yield, org.bukkit.inventory.ItemStack item, List<org.bukkit.Material> exemptions, String trigger, Collection<org.bukkit.inventory.ItemStack> drops)
      Constructor
      Parameters:
      player - The player who triggered TokenEnchant explosion
      what - The original block broken that triggered the explosion.
      blocks - A list of "to be exploded" blocks.
      yield - A multiplier (currently not used)
      item - An item a player was holding.
      exemptions - A list of materials, should be exempt from explosion.
      trigger - A name of the Enchantment that triggered this event.
      drops - A list of ItemStack to be dropped.
    • TEBlockExplodeEvent

      public TEBlockExplodeEvent(org.bukkit.entity.Player player, org.bukkit.block.Block what, List<org.bukkit.block.Block> blocks, float yield, org.bukkit.inventory.ItemStack item, List<org.bukkit.Material> exemptions, String trigger)
    • TEBlockExplodeEvent

      public TEBlockExplodeEvent(org.bukkit.entity.Player player, org.bukkit.block.Block what, List<org.bukkit.block.Block> blocks, float yield, org.bukkit.inventory.ItemStack item, List<org.bukkit.Material> exemptions)
      Constructor
      Parameters:
      player - The player who triggered TokenEnchant explosion
      what - The original block broken that triggered the explosion.
      blocks - A list of "to be exploded" blocks.
      yield - A multiplier (currently not used)
      item - An item a player was holding.
      exemptions - A list of materials, should be exempt from explosion.
    • TEBlockExplodeEvent

      public TEBlockExplodeEvent(org.bukkit.entity.Player player, org.bukkit.block.Block what, List<org.bukkit.block.Block> blocks, float yield, org.bukkit.inventory.ItemStack item, String trigger)
      Constructor
      Parameters:
      player - The player who triggered TokenEnchant explosion
      what - The original block broken that triggered the explosion.
      blocks - A list of "to be exploded" blocks.
      yield - A multiplier (currently not used)
      item - An item a player was holding.
    • TEBlockExplodeEvent

      public TEBlockExplodeEvent(org.bukkit.entity.Player player, org.bukkit.block.Block what, List<org.bukkit.block.Block> blocks, float yield, org.bukkit.inventory.ItemStack item)
      Constructor
      Parameters:
      player - The player who triggered TokenEnchant explosion
      what - The original block broken that triggered the explosion.
      blocks - A list of "to be exploded" blocks.
      yield - A multiplier (currently not used)
      item - An item a player was holding.
    • TEBlockExplodeEvent

      public TEBlockExplodeEvent(org.bukkit.entity.Player player, org.bukkit.block.Block what, List<org.bukkit.block.Block> blocks, float yield, String trigger)
      Constructor
      Parameters:
      player - The player who triggered TokenEnchant explosion
      what - The original block broken that triggered the explosion.
      blocks - A list of "to be exploded" blocks.
      yield - A multiplier (currently not used)
      trigger - An enchantment's name that triggered this event.
    • TEBlockExplodeEvent

      public TEBlockExplodeEvent(org.bukkit.entity.Player player, org.bukkit.block.Block what, List<org.bukkit.block.Block> blocks, float yield, String trigger, Collection<org.bukkit.inventory.ItemStack> drops, int expToDrop)
      Constructor
      Parameters:
      player - The player who triggered TokenEnchant explosion
      what - The original block broken that triggered the explosion.
      blocks - A list of "to be exploded" blocks.
      yield - A multiplier (currently not used)
      trigger - An enchantment's name that triggered this event.
    • TEBlockExplodeEvent

      public TEBlockExplodeEvent(org.bukkit.entity.Player player, org.bukkit.block.Block what, List<org.bukkit.block.Block> blocks, float yield, String trigger, Collection<org.bukkit.inventory.ItemStack> drops, int expToDrop, Object region)
      Constructor
      Parameters:
      player - The player who triggered TokenEnchant explosion
      what - The original block broken that triggered the explosion.
      blocks - A list of "to be exploded" blocks.
      yield - A multiplier (currently not used)
      trigger - An enchantment's name that triggered this event.
    • TEBlockExplodeEvent

      public TEBlockExplodeEvent(org.bukkit.entity.Player player, org.bukkit.block.Block what, List<org.bukkit.block.Block> blocks, float yield, String trigger, Collection<org.bukkit.inventory.ItemStack> drops)
      Constructor
      Parameters:
      player - The player who triggered TokenEnchant explosion
      what - The original block broken that triggered the explosion.
      blocks - A list of "to be exploded" blocks.
      yield - A multiplier (currently not used)
      trigger - An enchantment's name that triggered this event.
    • TEBlockExplodeEvent

      public TEBlockExplodeEvent(org.bukkit.entity.Player player, org.bukkit.block.Block what, List<org.bukkit.block.Block> blocks, float yield)
      Constructor
      Parameters:
      player - The player who triggered TokenEnchant explosion
      what - The original block broken that triggered the explosion.
      blocks - A list of "to be exploded" blocks.
      yield - A multiplier (currently not used)
  • Method Details

    • setBlockPerProcess

      public static void setBlockPerProcess(int num)
      sets the number of exploded blocks to be processed at the time.
      Parameters:
      num - the number of exploded blocks to be processed at the time.
    • getBlocksPerProcess

      public static int getBlocksPerProcess()
      Returns the number of exploded blocks to be processed at the time.
      Returns:
      the number of exploded blocks to be processed at the time.
    • isCancelled

      public boolean isCancelled()
      Specified by:
      isCancelled in interface org.bukkit.event.Cancellable
    • setCancelled

      public void setCancelled(boolean cancel)
      Specified by:
      setCancelled in interface org.bukkit.event.Cancellable
    • getRegion

      public Object getRegion()
      Returns the object representing the exploded region.
      Returns:
      the object representing the exploded region.
    • getExpToDrop

      public int getExpToDrop()
      Returns the amount of Exp to be dropped.
      Returns:
      the amount of Exp to be dropped.
    • blockList

      public List<org.bukkit.block.Block> blockList()
      Returns a list of blocks flagged as "to be exploded".
      Returns:
      a list of Block object to be exploded.
    • getDrops

      public Collection<org.bukkit.inventory.ItemStack> getDrops()
      Returns a list of ItemStack object to be dropped.
      Returns:
      a list of ItemStack object to be dropped.
    • getYield

      public float getYield()
      Returns a yielding multiplier. This value is currently not used and always set to 1.0F.
      Returns:
      a yielding multiplier.
    • setYield

      public void setYield(float yield)
      Sets a specified yielding multiplier.
      Parameters:
      yield - a yielding multiplier.
    • getHandlers

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

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

      public org.bukkit.entity.Player getPlayer()
      Returns a player who initiated this explosion.
      Returns:
      the Player who triggered this explosion.
    • setPlayer

      public void setPlayer(org.bukkit.entity.Player player)
      Sets the player who initiated this event.
      Parameters:
      player - the Player who triggered this explosion.
    • getItemStack

      public org.bukkit.inventory.ItemStack getItemStack()
      Returns an itemstack object associated with this explosion.
      Returns:
      an itemstack object associated with this explosion.
    • getExemptions

      public List<org.bukkit.Material> getExemptions()
      Returns a list of materials which are exempt from explosion.
      Returns:
      a ist of materials which are exempt from explosion.
    • getTrigger

      public String getTrigger()
      Returns a name of Enchantment (from TokenEnchant) which triggered this explosion
    • shouldDrop

      public static boolean shouldDrop(org.bukkit.block.Block b)
    • clearExplodedBlocks

      public static void clearExplodedBlocks(TEBlockExplodeEvent e)
    • clearExplodedBlocks

      public static void clearExplodedBlocks(TEBlockExplodeEvent e, boolean useWorldEdit)
    • clearExplodedBlocks

      @Deprecated public static void clearExplodedBlocks(List<org.bukkit.block.Block> blocks)
      Deprecated.
    • breakExplodedBlocks

      public static void breakExplodedBlocks(TEBlockExplodeEvent e)
    • breakExplodedBlocks

      @Deprecated public static void breakExplodedBlocks(List<org.bukkit.block.Block> blocks)
      Deprecated.
    • getDrops

      public static Collection<org.bukkit.inventory.ItemStack> getDrops(org.bukkit.block.Block block)
      Returns a list of items which would drop by destroying this block
      Returns:
      Collection a list of dropped items for this type of block
    • getDrops

      public static Collection<org.bukkit.inventory.ItemStack> getDrops(org.bukkit.block.Block block, org.bukkit.inventory.ItemStack tool)
      a list of dropped items for this type of block
      Parameters:
      block - The Bukkit Block to get the loots from.
      tool - The Item required to get the loot for the block.
      Returns:
      Collection a list of ItemStack instances to drop as loot for this CustomBlock.