Interface CompatibilityBlock


  • public interface CompatibilityBlock
    Add a backward compatibility layer to the Block class.
    Since:
    4.1M1
    Version:
    $Id: f4030390fadc9b6a41fcc89804ea52781c0584c2 $
    • Method Detail

      • getPreviousBlockByType

        @Deprecated
        <T extends Block> T getPreviousBlockByType​(Class<T> blockClass,
                                                   boolean recurse)
        Deprecated.
        since 3.0M3 use Block.getBlocks(BlockMatcher, Axes) instead
        Look upward to find a block which inherit or is provided type.

        The difference with getParentBlockByType(Class) is that this one look also at previous block in the same parent when getParentBlockByType(Class) only look at parents.

        Type Parameters:
        T - the class of the Blocks to return
        Parameters:
        blockClass - the block class to look for
        recurse - if true also search in parents levels
        Returns:
        the found block, null if nothing is found
        Since:
        1.6M1
      • getChildrenByType

        @Deprecated
        <T extends BlockList<T> getChildrenByType​(Class<T> blockClass,
                                                    boolean recurse)
        Deprecated.
        since 3.0M3 use Block#getBlocks(new ClassBlockMatcher(blockClass), Axes.DESCENDANT) instead if recurse was true and Block#getBlocks(new ClassBlockMatcher(blockClass), Axes.CHILD) otherwise
        Gets all the Blocks in the tree which are of the passed Block class.
        Type Parameters:
        T - the class of the Blocks to return
        Parameters:
        blockClass - the block class to look for
        recurse - if true also search recursively children
        Returns:
        all the matching blocks
        Since:
        1.6M1