PylonMultiblock

Represents a structure composed of multiple blocks.

This is an extremely flexible class designed to account for almost any multiblock you could want to create. However, most multiblocks can probably use PylonSimpleMultiblock.

Multiblocks are more difficult than normal Pylon blocks for the simple reason that a multiblock may contain some blocks that have not been loaded because they are in a different chunk.

Ticking multiblocks should only tick when isFormedAndFullyLoaded() returns true, to avoid ticking a multiblock that is either not formed, or not fully loaded (i.e., not all of its components are loaded).

See also

Inheritors

Properties

Link copied to clipboard
abstract val block: Block
Link copied to clipboard

All chunks containing at least one component of the multiblock

Functions

Link copied to clipboard

Returns true if every component of the multiblock is loaded AND the multiblock is formed. Reads from a cache, so call as often as you want.

Link copied to clipboard
abstract fun isPartOfMultiblock(otherBlock: Block): Boolean

Should return true if there is any scenario in which this block's position could be part of a formed multiblock.

Link copied to clipboard

Called when the multiblock is formed (i.e., was not formed before, but now is). This includes when the multiblock was previously formed, unloaded, and loaded again.

Link copied to clipboard

Called when the multiblock is unformed (i.e., was formed before, but now is not). This includes when a part of the multiblock is unloaded, and the multiblock becomes unformed because of it.