Multiblock Controller Block

Package:              com.codex.composer.api.v1.block
Canonical Name: com.codex.composer.api.v1.block.MultiblockControllerBlock

Optional convenience base class for controller blocks that don't need to extend anything else. It extends BlockWithEntity, so inheritors create their block entity as usual, usually one extending MultiblockControllerBlockEntity.

Nothing about it is required for a multiblock to work. Any block entity that implements MultiblockHost is a controller, regardless of its block. If your block has to extend something else (for example AbstractFurnaceBlock), just don't use this class.

Provides the following static helpers, usable from any code:

/* The controller at the given position, if the block entity there is a multiblock host. */
static Optional<MultiblockController> getController(BlockView world, BlockPos pos);
/* Whether the multiblock controlled at the given position is currently formed. */
static boolean isFormed(BlockView world, BlockPos pos);
/* World positions of the given extension of the controller at the given position. */
static List<BlockPos> getExtensions(BlockView world, BlockPos controllerPos, Identifier extensionId);