RebarCargoBlock

Represents a block that can connect to cargo ducts and use them to interface with other cargo RebarCargoBlocks.

Each face can have one logistic group which cargo ducts connected to that face are allowed to interface with

In your place constructor, you will need to call addCargoLogisticGroup for all the block faces you want to be able to connect cargo ducts to, and also setCargoTransferRate to set the maximum number of items that can be transferred out of this block per cargo tick.

Properties

Link copied to clipboard
abstract val block: Block

Automatically implemented when this interface is implemented by a io.github.pylonmc.rebar.block.RebarBlock

Link copied to clipboard
@get:ApiStatus.NonExtendable
open val cargoLogisticGroups: Map<BlockFace, String>
Link copied to clipboard
@get:ApiStatus.NonExtendable
@set:ApiStatus.NonExtendable
open var cargoTransferRate: Int
Link copied to clipboard
@get:ApiStatus.NonExtendable
open val heldEntities: MutableMap<String, UUID>

Functions

Link copied to clipboard
@ApiStatus.NonExtendable
open fun addCargoLogisticGroup(face: BlockFace, group: String)
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
open fun createLogisticGroup(groupName: String, group: LogisticGroup)
open fun createLogisticGroup(groupName: String, slotType: LogisticGroupType, vararg slots: LogisticSlot)
open fun createLogisticGroup(groupName: String, slotType: LogisticGroupType, slots: List<LogisticSlot>)
open fun createLogisticGroup(groupName: String, slotType: LogisticGroupType, inventory: VirtualInventory)
Link copied to clipboard
@ApiStatus.NonExtendable
open fun getCargoLogisticGroup(face: BlockFace): LogisticGroup?
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 : 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 fun getLogisticGroup(groupName: String): LogisticGroup?
Link copied to clipboard
Link copied to clipboard
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
Link copied to clipboard
Link copied to clipboard
@ApiStatus.NonExtendable
open fun removeCargoLogisticGroup(face: BlockFace)
Link copied to clipboard
open fun tickCargo()
Link copied to clipboard
open fun tickCargoFace(sourceGroup: LogisticGroup, targetGroup: LogisticGroup)
Link copied to clipboard
Link copied to clipboard
open fun tryRemoveEntity(name: String)
Link copied to clipboard
@ApiStatus.NonExtendable
open fun updateDirectlyConnectedFaces()

Checks if the block can connect to any adjacent cargo blocks, and if so, creates a duct display between this block and the adjacent cargo block in question.

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>)