Class PatternThorough

java.lang.Object
wtf.choco.veinminer.pattern.PatternThorough
All Implemented Interfaces:
org.bukkit.Keyed, VeinMiningPattern

public final class PatternThorough
extends Object
implements VeinMiningPattern
A VeinMiningPattern implementation that "pulsates" from the origin outwards. Every iteration, every block starting from the origin will be checks for adjacent blocks.

This pattern is less efficient than PatternExpansive when used for larger veins, but may be more performant when dealing with smaller veins.

This pattern should be considered as effectively deprecated. While not literally deprecated, the expansive pattern should be used in place of this as it will yield results more quickly and in an efficient manner.

Author:
Parker Hawke - 2008Choco
  • Method Details

    • allocateBlocks

      public void allocateBlocks​(Set<org.bukkit.block.Block> blocks, VeinBlock type, org.bukkit.block.Block origin, ToolCategory category, ToolTemplate toolTemplate, AlgorithmConfig algorithmConfig, MaterialAlias alias)
      Description copied from interface: VeinMiningPattern
      Allocate the blocks that should be broken by the vein mining pattern. Note that the breaking of the blocks should not be handled by the pattern, but rather the plugin itself. This method serves primarily to search for valid blocks to break in a vein.

      NOTE: If null is added to the "blocks" set, a NullPointerException will be thrown and the method will fail.

      Specified by:
      allocateBlocks in interface VeinMiningPattern
      Parameters:
      blocks - a set of all blocks to break. Valid blocks should be added here. The "origin" block passed to this method will be added automatically
      type - the type of VeinBlock being vein mined
      origin - the block where the vein mine was initiated
      category - the tool category used to break the block
      toolTemplate - the tool template used to break the block. May be null
      algorithmConfig - the algorithm configuration
      alias - an alias of the block being broken if one exists. May be null
    • getKey

      public org.bukkit.NamespacedKey getKey()
      Specified by:
      getKey in interface org.bukkit.Keyed
    • get

      public static PatternThorough get()
      Get a singleton instance of the default pattern.
      Returns:
      the default pattern