Interface VeinMinerBlock

All Superinterfaces:
Comparable<VeinMinerBlock>
All Known Implementing Classes:
VeinMinerBlockState, VeinMinerBlockType, VeinMinerBlockWildcard

public interface VeinMinerBlock extends Comparable<VeinMinerBlock>
Represents a block understood by vein miner.
  • Field Details

  • Method Details

    • getType

      @NotNull @NotNull BlockType getType()
      Get the BlockType represented by this block.
      Returns:
      the type
    • getState

      @NotNull @NotNull BlockState getState()
      Get the BlockState represented by this block.

      If this block has no state (e.g. hasState() is false), this method should return a state with default block state values.

      Returns:
      the state
    • hasState

      boolean hasState()
      Check whether or not this block has at least one state set.
      Returns:
      true if a state is set, false otherwise
    • matchesType

      boolean matchesType(@NotNull @NotNull BlockType type)
      Check whether or not this VeinMinerBlock matches the given BlockType.
      Parameters:
      type - the type to check
      Returns:
      true if this block matches the given type, false otherwise
    • matchesState

      boolean matchesState(@NotNull @NotNull BlockState state, boolean exact)
      Check whether or not this VeinMinerBlock matches the given BlockState.
      Parameters:
      state - the state to check
      exact - whether or not to match against all states
      Returns:
      true if matches, false otherwise
    • matchesState

      default boolean matchesState(@NotNull @NotNull BlockState state)
      Check whether or not this VeinMinerBlock matches the given state.

      The provided state will match if the states explicitly declared by this block match. Any states not explicitly set by this block will be ignored.

      Parameters:
      state - the state to check
      Returns:
      true if matches, false otherwise
    • toStateString

      @NotNull @NotNull String toStateString()
      Get this VeinMinerBlock as a state string.
      Returns:
      the state string
    • compareTo

      default int compareTo(@Nullable @Nullable VeinMinerBlock other)
      Specified by:
      compareTo in interface Comparable<VeinMinerBlock>
    • fromString

      @Nullable static @Nullable VeinMinerBlock fromString(@NotNull @NotNull String string)
      Get a VeinMinerBlock from a string. Example states:
       chest
       minecraft:chest
       minecraft:chest[waterlogged=true]
       minecraft:chest[facing=north,waterlogged=true]
       * // The wildcard state
       
      Parameters:
      string - the string from which to parse a VeinMinerBlock instance
      Returns:
      the constructed VeinMinerBlock, or null if an invalid format was provided