Class PlayerVeinMineEvent
java.lang.Object
org.bukkit.event.Event
org.bukkit.event.player.PlayerEvent
wtf.choco.veinminer.api.event.player.PlayerVeinMineEvent
- All Implemented Interfaces:
Cancellable
Called when a player uses vein miner.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
Event.Result
-
Field Summary
Fields inherited from class org.bukkit.event.player.PlayerEvent
player
-
Constructor Summary
ConstructorDescriptionPlayerVeinMineEvent
(@NotNull Player player, @NotNull Block block, @NotNull VeinMinerBlock veinMinerBlock, @Nullable ItemStack itemStack, @NotNull VeinMinerToolCategory category, @NotNull Set<Block> blocks, @NotNull VeinMiningPattern pattern) Construct a newPlayerVeinMineEvent
. -
Method Summary
Modifier and TypeMethodDescription@NotNull Block
getBlock()
Get the originBlock
that was destroyed to trigger this vein mine.Get aSet
of all blocks destroyed by this vein mine.@NotNull VeinMinerToolCategory
Get the category used for this vein mine.static @NotNull HandlerList
@NotNull HandlerList
@Nullable ItemStack
getItem()
Get the item used to vein mine (if any).@NotNull VeinMiningPattern
Get theVeinMiningPattern
used for this vein mine.@NotNull VeinMinerBlock
Get theVeinMinerBlock
broken at the origin in this event.boolean
void
setCancelled
(boolean cancel) Methods inherited from class org.bukkit.event.player.PlayerEvent
getPlayer
Methods inherited from class org.bukkit.event.Event
getEventName, isAsynchronous
-
Constructor Details
-
PlayerVeinMineEvent
public PlayerVeinMineEvent(@NotNull @NotNull Player player, @NotNull @NotNull Block block, @NotNull @NotNull VeinMinerBlock veinMinerBlock, @Nullable @Nullable ItemStack itemStack, @NotNull @NotNull VeinMinerToolCategory category, @NotNull @NotNull Set<Block> blocks, @NotNull @NotNull VeinMiningPattern pattern) Construct a newPlayerVeinMineEvent
.- Parameters:
player
- the player performing the vein mineblock
- the originBlock
that was broken by the playerveinMinerBlock
- the type ofVeinMinerBlock
that was broken at the originitemStack
- theItemStack
used to vein minecategory
- theVeinMinerToolCategory
of the itemStackblocks
- the blocks to be destroyed as a result of vein minerpattern
- the pattern used to vein mine
-
-
Method Details
-
getBlock
Get the originBlock
that was destroyed to trigger this vein mine.- Returns:
- the origin block
-
getVeinMinerBlock
Get theVeinMinerBlock
broken at the origin in this event.- Returns:
- the block
-
getItem
Get the item used to vein mine (if any). Any changes made to theItemStack
returned by this method will not be reflected in the player's inventory.- Returns:
- the item used to vein mine. null if none
-
getCategory
Get the category used for this vein mine.- Returns:
- the category
-
getBlocks
Get aSet
of all blocks destroyed by this vein mine. This set is mutable. Changes made to the returned collection will directly affect what blocks are destroyed.Note that just because a block is present in the returned collection does not mean that it will be destroyed for certain. Additional checks are made on the blocks in this collection during the vein mining process including whether or not the player is allowed to break the block (e.g. support for land claiming plugins or other protection plugins such as WorldGuard).
- Returns:
- the blocks to be destroyed
-
getPattern
Get theVeinMiningPattern
used for this vein mine.- Returns:
- the pattern used
-
isCancelled
public boolean isCancelled()- Specified by:
isCancelled
in interfaceCancellable
-
setCancelled
public void setCancelled(boolean cancel) - Specified by:
setCancelled
in interfaceCancellable
-
getHandlers
- Specified by:
getHandlers
in classEvent
-
getHandlerList
-