PylonBlock

open class PylonBlock(source)

Represents a Pylon block in the world.

All custom Pylon blocks extend this class. Every instance of this class is wrapping a real block in the world, and is stored in BlockStorage. All new block types must be registered using register.

An implementation of PylonBlock must have two constructors: one that takes a Block and a BlockCreateContext, and one that takes a Block and a PersistentDataContainer. The first constructor is known as the "create constructor", and is used when the block is created in the world. The second constructor is known as the "load constructor", and is used to reconstruct the block when the chunk containing the block is loaded.

See also

Inheritors

Constructors

Link copied to clipboard
constructor(block: Block, context: BlockCreateContext)

This constructor is called when a new block is created in the world.

constructor(block: Block, pdc: PersistentDataContainer)

This constructor is called when the block is loaded. For example, if the server restarts, we need to create a new PylonBlock instance, and we'll do it with this constructor.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
val blockTextureEntity: WrapperEntity?

A packet based ItemDisplay sent to players with customBlockTextures enabled.

Link copied to clipboard
Link copied to clipboard

Set this to true if your block should not have a blockTextureEntity for custom models/textures.

Link copied to clipboard
Link copied to clipboard

All the data needed to create or load the block.

Functions

Link copied to clipboard

Returns the item that should be used to display the block's texture.

Link copied to clipboard

Returns the item that the block should drop.

Link copied to clipboard
open fun getPickItem(): ItemStack?

Returns the item that should be given when the block is middle clicked.

Link copied to clipboard

Returns settings associated with the block.

Link copied to clipboard
open fun getWaila(player: Player): WailaConfig?

WAILA is the text that shows up when looking at a block to tell you what the block is.

Link copied to clipboard

Called when the block is saved.

Link copied to clipboard

Called when debug info is requested for the block by someone using the DebugWaxedWeatheredCutCopperStairs. If there is any transient data that can be useful for debugging, you're encouraged to serialize it here.