Interface BlockRelocability

All Known Implementing Classes:
BlockRelocability.Multiblock, BlockRelocability.No, BlockRelocability.Yes

public sealed interface BlockRelocability permits BlockRelocability.No, BlockRelocability.Yes, BlockRelocability.Multiblock

Declares whether some block is relocatable by mechanics which cut/copy and paste blocks, typically with some translation and possibly a rotation and/or mirror, and including any blockentity data.

Relocator mechanics may query IBlockStateExtension.getRelocability(LevelReader, BlockPos) for each block in some area being moved.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static final record 
    BlockRelocability indicating a block may be moved if and only if some set of other block positions is being moved with it.
    static enum 
    BlockRelocability indicating some block is currently refusing to be moved
    static enum 
    BlockRelocability indicating some block is currently agreeing to be moved
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    isRelocatable(Set<BlockPos> relocatingPositions)
    Returns true if the block is relocatable from a given Set of block positions, false otherwise.
  • Method Details

    • isRelocatable

      boolean isRelocatable(Set<BlockPos> relocatingPositions)
      Returns true if the block is relocatable from a given Set of block positions, false otherwise.
      Parameters:
      relocatingPositions - Set of positions blocks are being relocated from
      Returns:
      true if the block is relocatable from a given Set of block positions, false otherwise