Constructors

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

Types

Link copied to clipboard

Properties

Link copied to clipboard

Implemented automatically by any class that extends PylonBlock

Link copied to clipboard

A packet based ItemDisplay sent to players who have customBlockTextures enabled.

Link copied to clipboard
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
open override val facadeDefaultBlockType: Material
Link copied to clipboard
@get:ApiStatus.NonExtendable
open val heldEntities: MutableMap<String, UUID>
Link copied to clipboard
open override val isCulledAsync: Boolean

If onVisible and onCulled should be called asynchronously instead of scheduled to be called on the main thread.

Link copied to clipboard
open override val key: NamespacedKey
Link copied to clipboard

All the data needed to create or load the block.

Functions

Link copied to clipboard
open fun addEntity(name: String, entity: RebarEntity<*>)
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

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

Link copied to clipboard

Returns a map of custom block state properties to be used for the block texture item. These properties will be merged with the vanilla block state properties of the block.

Link copied to clipboard

Returns the item that the block should drop.

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 getHeldRebarEntity(name: String): RebarEntity<*>?
@ApiStatus.NonExtendable
open fun <T : RebarEntity<*>> getHeldRebarEntity(clazz: Class<T>, name: String): T?
Link copied to clipboard
@ApiStatus.NonExtendable
open fun <T : RebarEntity<*>> getHeldRebarEntityOrThrow(clazz: Class<T>, name: String): T
Link copied to clipboard
open override fun getKey(): NamespacedKey
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): WailaDisplay?

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

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 isVisible(player: Player): Boolean

If the block is currently visible to the player. Used only to determine which io.github.pylonmc.rebar.culling.PlayerCullingConfig interval to use

Link copied to clipboard
open fun key(): @NotNull Key
Link copied to clipboard
open fun onBreak(drops: MutableList<ItemStack>, context: BlockBreakContext)

Called as the block is being broken. At this point, the block break cannot be cancelled, but the physical block has not yet been broken or removed from io.github.pylonmc.rebar.block.BlockStorage.

Link copied to clipboard
open override fun onCulled(player: Player)

Does not do anything for group culled blocks, see onGroupCulled

Link copied to clipboard
open override fun onGroupCulled(player: Player, group: RebarGroupCulledBlock.CullingGroup)
Link copied to clipboard
open override fun onGroupVisible(player: Player, group: RebarGroupCulledBlock.CullingGroup)
Link copied to clipboard
open override fun onInteract(event: PlayerInteractEvent, priority: EventPriority)

This may be called for both hands, so make sure you check which hand is used.

Link copied to clipboard
open override fun onVisible(player: Player)

Does not do anything for group culled blocks, see onGroupVisible

Link copied to clipboard
open override fun postBreak(context: BlockBreakContext)

Called after the block has been broken. At this point, the block has been physically removed, block drops have been dropped, and the block has been removed from io.github.pylonmc.rebar.block.BlockStorage.

Link copied to clipboard
open fun postInitialise()

Called after both the create constructor and the load constructor.

Link copied to clipboard
open fun preBreak(context: BlockBreakContext): Boolean

Called before the block is broken. Note this is not called for Deletions as those are not cancellable.

Link copied to clipboard

Call this method to refresh the block texture entity's item to be the result of getBlockTextureItem, or a barrier if that returns null.

Link copied to clipboard

Schedules the block texture item to be refreshed on the next server tick. See refreshBlockTextureItem.

Link copied to clipboard
Link copied to clipboard
open fun tryRemoveEntity(name: String)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
@ApiStatus.NonExtendable
open fun whenHeldRebarEntityLoads(name: String, consumer: Consumer<RebarEntity<*>>)
@ApiStatus.NonExtendable
open fun <T : RebarEntity<*>> whenHeldRebarEntityLoads(clazz: Class<T>, name: String, consumer: Consumer<T>)
Link copied to clipboard
open override fun write(pdc: PersistentDataContainer)

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.