Package com.vk2gpz.tokenenchant.event
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
FieldsModifier and TypeFieldDescriptionstatic int
A number of blocks processed at a time.Fields inherited from class org.bukkit.event.block.BlockEvent
block
-
Constructor Summary
ConstructorsConstructorDescriptionTEBlockExplodeEvent
(org.bukkit.entity.Player player, org.bukkit.block.Block what, List<org.bukkit.block.Block> blocks, float yield) ConstructorTEBlockExplodeEvent
(org.bukkit.entity.Player player, org.bukkit.block.Block what, List<org.bukkit.block.Block> blocks, float yield, String trigger) ConstructorTEBlockExplodeEvent
(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) ConstructorTEBlockExplodeEvent
(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) ConstructorTEBlockExplodeEvent
(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) ConstructorTEBlockExplodeEvent
(org.bukkit.entity.Player player, org.bukkit.block.Block what, List<org.bukkit.block.Block> blocks, float yield, org.bukkit.inventory.ItemStack item) ConstructorTEBlockExplodeEvent
(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) ConstructorTEBlockExplodeEvent
(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) ConstructorTEBlockExplodeEvent
(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) ConstructorTEBlockExplodeEvent
(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) ConstructorTEBlockExplodeEvent
(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 TypeMethodDescriptionList
<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> getDrops()
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 blockstatic 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 blockList
<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 explosionfloat
getYield()
Returns a yielding multiplier.boolean
static void
setBlockPerProcess
(int num) 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
-
Field Details
-
BLOCKS_PER_PROCESS
public static int BLOCKS_PER_PROCESSA 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 explosionwhat
- 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 explosionwhat
- 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 explosionwhat
- 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
-
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 explosionwhat
- 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 explosionwhat
- 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 explosionwhat
- 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 explosionwhat
- 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 explosionwhat
- 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 explosionwhat
- 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 explosionwhat
- 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 explosionwhat
- 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 interfaceorg.bukkit.event.Cancellable
-
setCancelled
public void setCancelled(boolean cancel) - Specified by:
setCancelled
in interfaceorg.bukkit.event.Cancellable
-
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
Returns a list of blocks flagged as "to be exploded".- Returns:
- a list of Block object to be exploded.
-
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 classorg.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
Returns a list of materials which are exempt from explosion.- Returns:
- a ist of materials which are exempt from explosion.
-
getTrigger
Returns a name of Enchantment (from TokenEnchant) which triggered this explosion -
shouldDrop
public static boolean shouldDrop(org.bukkit.block.Block b) -
clearExplodedBlocks
-
clearExplodedBlocks
-
clearExplodedBlocks
Deprecated. -
breakExplodedBlocks
-
breakExplodedBlocks
Deprecated. -
getDrops
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.
-