Class VMEventFactory

java.lang.Object
wtf.choco.veinminer.util.VMEventFactory

public final class VMEventFactory extends Object
A collection of factory methods for VeinMiner events.
  • Method Details

    • callPlayerVeinMineEvent

      @NotNull public static @NotNull PlayerVeinMineEvent callPlayerVeinMineEvent(@NotNull @NotNull Player player, @NotNull @NotNull Block block, @NotNull @NotNull VeinMinerBlock veinMinerBlock, @Nullable @Nullable ItemStack item, @NotNull @NotNull VeinMinerToolCategory category, @NotNull @NotNull Set<Block> blocks, @NotNull @NotNull VeinMiningPattern pattern)
      Parameters:
      player - the player
      block - the origin block that was broken by the player
      veinMinerBlock - the type of block being vein mined
      item - the item used to vein mine
      category - the tool category
      blocks - the blocks being vein mined
      pattern - the pattern being used to vein mine
      Returns:
      the event
    • handlePlayerClientActivateVeinMinerEvent

      public static boolean handlePlayerClientActivateVeinMinerEvent(@NotNull @NotNull Player player, boolean activated)
      Parameters:
      player - the player
      activated - the new activation state
      Returns:
      true if not cancelled, false if cancelled
    • callPlayerVeinMiningPatternChangeEvent

      @NotNull public static @NotNull PlayerVeinMiningPatternChangeEvent callPlayerVeinMiningPatternChangeEvent(@NotNull @NotNull Player player, @NotNull @NotNull VeinMiningPattern currentPattern, @NotNull @NotNull VeinMiningPattern newPattern, @NotNull PatternChangeEvent.Cause cause)
      Parameters:
      player - the player whose pattern was changed
      currentPattern - the player's current pattern
      newPattern - the pattern to be set
      cause - the cause of the event
      Returns:
      the called event