PylonSimpleMultiblock

A multiblock that is made of a predefined set of components.

Automatically creates ghost blocks to show how to build your multiblock.

Automatically handles different possible rotations of your multiblock.

If you need something more flexible (eg: a fluid tank that can have up to 10 fluid casings added to increase the capacity), see PylonMultiblock.

Types

Link copied to clipboard

Represents a single block of a multiblock.

Link copied to clipboard

A block display that represents this block, showing the player what block needs to be placed in a specific location.

Link copied to clipboard

Represents a Pylon block component of a multiblock.

Link copied to clipboard

Represents a vanilla component of a multiblock, which can have one or more materials.

Properties

Link copied to clipboard
abstract val block: Block
Link copied to clipboard
open override val chunksOccupied: Set<ChunkPosition>

All chunks containing at least one component of the multiblock

Link copied to clipboard

The positions and corresponding components of the multiblock.

Link copied to clipboard
@get:ApiStatus.NonExtendable
open val heldEntities: MutableMap<String, UUID>
Link copied to clipboard

Imagine the smallest square containing the multiblock; this is the radius of that square.

Link copied to clipboard

Imagine the smallest cuboid (with equal width and length) containing the multiblock; this is the corner with the highest X, Y, and Z coordinates.

Link copied to clipboard

Imagine the smallest cuboid (with equal width and length) containing the multiblock; this is the corner with the lowest X, Y, and Z coordinates.

Functions

Link copied to clipboard
open fun addEntity(name: String, entity: PylonEntity<*>)
open fun addEntity(name: String, entity: Entity)
Link copied to clipboard
@ApiStatus.NonExtendable
open fun areAllHeldEntitiesLoaded(): Boolean

Returns false if any entity is unloaded or does not exist.

Link copied to clipboard
open override fun checkFormed(): Boolean

Warning: You should not call this yourself. If you want to know if the multiblock is formed, use isFormedAndFullyLoaded(), which will read from a cache, so is much faster.

Link copied to clipboard
open override fun getFacing(): BlockFace?

The 'direction' we expect the multiblock to be built in. This is not the actual direction that the multiblock has been built in.

Link copied to clipboard
@ApiStatus.NonExtendable
open fun getHeldEntity(name: String): Entity?
@ApiStatus.NonExtendable
open fun <T : Entity> getHeldEntity(clazz: Class<T>, name: String): T?
Link copied to clipboard
@ApiStatus.NonExtendable
open fun getHeldEntityOrThrow(name: String): Entity
@ApiStatus.NonExtendable
open fun <T : Entity> getHeldEntityOrThrow(clazz: Class<T>, name: String): T
Link copied to clipboard
@ApiStatus.NonExtendable
open fun getHeldEntityUuid(name: String): UUID?
Link copied to clipboard
@ApiStatus.NonExtendable
open fun getHeldEntityUuidOrThrow(name: String): UUID
Link copied to clipboard
@ApiStatus.NonExtendable
open fun <T : PylonEntity<*>> getHeldPylonEntity(clazz: Class<T>, name: String): T?
Link copied to clipboard
@ApiStatus.NonExtendable
open fun <T : PylonEntity<*>> getHeldPylonEntityOrThrow(clazz: Class<T>, name: String): T
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
@ApiStatus.NonExtendable
open fun isHeldEntityPresent(name: String): Boolean

Returns false if the block holds no entity with the provided name, the entity is unloaded or does not physically exist.

Link copied to clipboard
open override 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
open fun onBreak(drops: MutableList<ItemStack>, context: BlockBreakContext)
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.

Link copied to clipboard
@MustBeInvokedByOverriders
open override fun postBreak()
Link copied to clipboard
open fun setFacing(facing: BlockFace?)

Sets the 'direction' we expect the multiblock to be built in. North is considered the default facing direction - ie setFacing(BlockFace.NORTH) will preserve the original multiblock structure without rotating it.

Link copied to clipboard

Returns all the valid configurations of the multiblock. If any of these is satisfied, the multiblock will be considered complete.