DefaultEnergyHolder

class DefaultEnergyHolder(compound: Provider<Compound>, energy: MutableProvider<Long>, val maxEnergyProvider: Provider<Long>, val allowedConnectionType: NetworkConnectionType, blockedFaces: Set<BlockFace>, defaultConnectionConfig: () -> Map<BlockFace, NetworkConnectionType>) : EnergyHolder

The default EnergyHolder implementation.

Parameters

compound

the Compound for data storage and retrieval

energy

the Provider for the current energy amount

maxEnergyProvider

the maximum amount of energy this EnergyHolder can store

allowedConnectionType

determines whether energy can be inserted, extracted, or both

defaultConnectionConfig

the default (BlockFace, NetworkConnectionType) to be used if no configuration is stored

Constructors

Link copied to clipboard
constructor(compound: Provider<Compound>, energy: MutableProvider<Long>, maxEnergyProvider: Provider<Long>, allowedConnectionType: NetworkConnectionType, blockedFaces: Set<BlockFace>, defaultConnectionConfig: () -> Map<BlockFace, NetworkConnectionType>)

Properties

Link copied to clipboard
Link copied to clipboard
open override val allowedFaces: Set<BlockFace>

A set of BlockFaces where connections are allowed.

Link copied to clipboard
open override val blockedFaces: EnumSet<BlockFace>

The BlockFaces that can never have a connection.

Link copied to clipboard
open override val connectionConfig: MutableMap<BlockFace, NetworkConnectionType>

Stores which NetworkConnectionType is used for each BlockFace.

Link copied to clipboard
open override var energy: Long

The current amount of energy in this EnergyHolder.

Link copied to clipboard

The amount of energy that was extracted during the last energy network tick.

Link copied to clipboard
val energyMinusProvider: Provider<Long>

A Provider that shows the amount of energy that was extracted during the last energy network tick.

Link copied to clipboard

The amount of energy that was inserted during the last energy network tick.

Link copied to clipboard
val energyPlusProvider: Provider<Long>

A Provider that shows the amount of energy that was inserted during the last energy network tick.

Link copied to clipboard
val energyProvider: Provider<Long>

A Provider for the current energy amount.

Link copied to clipboard
open override val maxEnergy: Long

The maximum amount of energy this EnergyHolder can store.

Link copied to clipboard
val maxEnergyProvider: Provider<Long>