Class MaterialAlias

java.lang.Object
wtf.choco.veinminer.data.MaterialAlias
All Implemented Interfaces:
Cloneable, Iterable<VeinBlock>

public class MaterialAlias
extends Object
implements Iterable<VeinBlock>, Cloneable
Represents an aliasing between multiple VeinBlocks which VeinMiner can recognise as a single material value when being vein mined.
  • Constructor Summary

    Constructors 
    Constructor Description
    MaterialAlias​(@NotNull VeinBlock... blocks)
    Construct a new alias between varying vein blocks.
  • Method Summary

    Modifier and Type Method Description
    void addAlias​(@NotNull VeinBlock block)
    Add a block to this alias.
    @NotNull MaterialAlias clone()  
    boolean equals​(Object object)  
    @NotNull Set<VeinBlock> getAliasedBlocks()
    Get all blocks that are considered under this alias.
    int hashCode()  
    boolean isAliased​(@NotNull org.bukkit.block.Block block)
    Check whether a block is aliased under this material alias.
    boolean isAliased​(@NotNull org.bukkit.block.data.BlockData data)
    Check whether a material with specific block data is aliased under this material alias.
    boolean isAliased​(@NotNull org.bukkit.Material material)
    Check whether a material with no specific block data is aliased under this material alias.
    boolean isAliased​(@NotNull VeinBlock block)
    Check whether a block is aliased under this material alias.
    @NotNull Iterator<VeinBlock> iterator()  
    void removeAlias​(@NotNull org.bukkit.block.data.BlockData data)
    Remove a material with specific block data from this alias.
    void removeAlias​(@NotNull org.bukkit.Material material)
    Remove a material without any specific block data from this alias.
    void removeAlias​(@NotNull VeinBlock block)
    Remove a NVeinBlock from this alias.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface java.lang.Iterable

    forEach, spliterator
  • Constructor Details

    • MaterialAlias

      public MaterialAlias​(@NotNull @NotNull VeinBlock... blocks)
      Construct a new alias between varying vein blocks.
      Parameters:
      blocks - the blocks to alias
  • Method Details

    • addAlias

      public void addAlias​(@NotNull @NotNull VeinBlock block)
      Add a block to this alias.
      Parameters:
      block - the block to add
    • removeAlias

      public void removeAlias​(@NotNull @NotNull VeinBlock block)
      Remove a NVeinBlock from this alias.
      Parameters:
      block - the block to remove
    • removeAlias

      public void removeAlias​(@NotNull @NotNull org.bukkit.block.data.BlockData data)
      Remove a material with specific block data from this alias.
      Parameters:
      data - the data to remove
    • removeAlias

      public void removeAlias​(@NotNull @NotNull org.bukkit.Material material)
      Remove a material without any specific block data from this alias.
      Parameters:
      material - the material to remove
    • isAliased

      public boolean isAliased​(@NotNull @NotNull VeinBlock block)
      Check whether a block is aliased under this material alias.
      Parameters:
      block - the block to check
      Returns:
      true if aliased, false otherwise
    • isAliased

      public boolean isAliased​(@NotNull @NotNull org.bukkit.block.data.BlockData data)
      Check whether a material with specific block data is aliased under this material alias.
      Parameters:
      data - the data to check
      Returns:
      true if aliased, false otherwise
    • isAliased

      public boolean isAliased​(@NotNull @NotNull org.bukkit.block.Block block)
      Check whether a block is aliased under this material alias.
      Parameters:
      block - the block to check
      Returns:
      true if aliased, false otherwise
    • isAliased

      public boolean isAliased​(@NotNull @NotNull org.bukkit.Material material)
      Check whether a material with no specific block data is aliased under this material alias.
      Parameters:
      material - the material to check
      Returns:
      true if aliased, false otherwise
    • getAliasedBlocks

      @NotNull public @NotNull Set<VeinBlock> getAliasedBlocks()
      Get all blocks that are considered under this alias. A copy of the set is returned, therefore any changes made to the returned set will not affect this MaterialAlias.
      Returns:
      all aliased blocks
    • iterator

      @NotNull public @NotNull Iterator<VeinBlock> iterator()
      Specified by:
      iterator in interface Iterable<VeinBlock>
    • clone

      @NotNull public @NotNull MaterialAlias clone()
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals​(Object object)
      Overrides:
      equals in class Object