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

public class PlayerVeinMineEvent extends PlayerEvent implements Cancellable
Called when a player uses vein miner.
  • 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 new PlayerVeinMineEvent.
      Parameters:
      player - the player performing the vein mine
      block - the origin Block that was broken by the player
      veinMinerBlock - the type of VeinMinerBlock that was broken at the origin
      itemStack - the ItemStack used to vein mine
      category - the VeinMinerToolCategory of the itemStack
      blocks - the blocks to be destroyed as a result of vein miner
      pattern - the pattern used to vein mine
  • Method Details

    • getBlock

      @NotNull public @NotNull Block getBlock()
      Get the origin Block that was destroyed to trigger this vein mine.
      Returns:
      the origin block
    • getVeinMinerBlock

      @NotNull public @NotNull VeinMinerBlock getVeinMinerBlock()
      Get the VeinMinerBlock broken at the origin in this event.
      Returns:
      the block
    • getItem

      @Nullable public @Nullable ItemStack getItem()
      Get the item used to vein mine (if any). Any changes made to the ItemStack returned by this method will not be reflected in the player's inventory.
      Returns:
      the item used to vein mine. null if none
    • getCategory

      @NotNull public @NotNull VeinMinerToolCategory getCategory()
      Get the category used for this vein mine.
      Returns:
      the category
    • getBlocks

      @NotNull public @NotNull Set<Block> getBlocks()
      Get a Set 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

      @NotNull public @NotNull VeinMiningPattern getPattern()
      Get the VeinMiningPattern used for this vein mine.
      Returns:
      the pattern used
    • isCancelled

      public boolean isCancelled()
      Specified by:
      isCancelled in interface Cancellable
    • setCancelled

      public void setCancelled(boolean cancel)
      Specified by:
      setCancelled in interface Cancellable
    • getHandlers

      @NotNull public @NotNull HandlerList getHandlers()
      Specified by:
      getHandlers in class Event
    • getHandlerList

      @NotNull public static @NotNull HandlerList getHandlerList()