Skip to content
LeviMC
English
AutoLightDark
LeviLamina
Loading...
Searching...
No Matches
Block Class Reference

Public Types

using BlockStateValueType = std::variant<int, float, bool, std::string>
using BlockStatesType = std::vector<std::pair<std::string, BlockStateValueType>>

Public Member Functions

LLNDAPI bool isAir () const
bool hasProperty (BlockProperty type) const
BlockType const & getBlockType () const
std::string const & getTypeName () const
unsigned short getBlockItemId () const
ushort getData () const
Material const & getMaterial () const
template<typename T>
std::optional< T > getState (uint64 id) const
template<typename T>
std::optional< T > getState (BlockState const &state) const
template<typename T>
optional_ref< Block const > setState (uint64 id, T value) const
template<typename T>
optional_ref< Block const > setState (BlockState const &state, T value) const
bool operator== (Block const &other) const
template<typename T>
MCAPI T const * tryGetComponent () const
void cacheComponentData ()
 Refreshes the data cached on this block state from its components and block type.
LLNDAPI BlockOcclusionType _getBlockOcclusionType () const
 The block type properties and material are inspected in order of decreasing priority.
MCAPI Block (ushort data, ::gsl::not_null<::BlockType * > oldBlock)
MCAPI Block (ushort data, ::gsl::not_null<::BlockType * > oldBlock, ::CompoundTag serId, uint const &runId)
MCAPI bool _isSolid () const
MCAPI void _queueForTickBasedOnComponentConfiguration (::BlockSource &region, ::BlockPos const &pos, ::Random &random, bool placingBlock) const
MCAPI void _removeFromTickingQueues (::BlockSource &region, ::BlockPos const &pos) const
MCAPI::Block & addTag (::HashedString const &tag)
MCAPI::ItemInstance asItemInstance (::BlockSource &region, ::BlockPos const &position, bool withData) const
MCAPI bool breaksFallingBlocks (::BaseGameVersion version) const
MCAPI::std::string buildDescriptionId () const
MCAPI::std::string buildDescriptionName () const
MCAPI void buildSerializationId (uint latestUpdaterVersion)
MCAPI bool canConnect (::Block const &connectionBlock, uchar toOther) const
MCAPI bool canProvideFullSupport (uchar face) const
MCAPI bool canProvideSupport (uchar face, ::BlockSupportType type) const
MCAPI bool canSurvive (::BlockSource &region, ::BlockPos const &pos) const
MCAPI::HitResult clip (::BlockPos const &pos, ::Vec3 const &A, ::Vec3 const &B, ::AABB const &aabb) const
MCAPI::HitResult clip (::BlockSource const &region, ::BlockPos const &pos, ::Vec3 const &A, ::Vec3 const &B, ::ShapeType shapeType, ::optional_ref<::GetCollisionShapeInterface const > entity) const
MCAPI uint computeRawSerializationIdHashForNetwork () const
MCAPI::Block const & copyState (::Block const &fromBlock, ::BlockState const &state) const
MCAPI void executeItemEvent (::ItemStackBase &item, ::std::string const &eventName, ::BlockSource &region, ::BlockPos const &pos, ::Actor &actor, ::HandSlot handSlot) const
MCAPI void finalizeBlockComponentStorage ()
MCAPI ::std::optional<::ConnectionID > getConnectionID () const
MCAPI::std::string getDescriptionId () const
MCAPI float getDestroySpeed (::ItemStackBase const &item) const
MCAPI::std::string getDisplayName () const
MCAPI bool hasTag (::HashedString const &tagName) const
MCAPI bool isCropBlock () const
MCAPI bool isPartialBlock (::BlockSource const &region, ::BlockPos const &pos) const
MCAPI bool isPreservingMediumWhenPlaced (::Block const &medium) const
MCAPI bool isTopPartialBlock (::BlockSource const &region, ::BlockPos const &pos) const
MCAPI::Block const & keepStates (::std::vector<::BlockState const * > const &statesToKeep) const
MCAPI bool mayPlace (::BlockSource &region, ::BlockPos const &pos, uchar face, ::Actor const *placer) const
MCAPI void neighborChanged (::BlockSource &region, ::BlockPos const &pos, ::BlockPos const &neighborPos) const
MCAPI void onActorEvent (::BlockPos const &pos, ::std::string const &eventName, ::Actor &sourceEntity) const
MCAPI void onActorInternalEvent (::BlockPos const &pos, ::std::string const &eventName, ::Actor &sourceEntity) const
MCAPI void onRemove (::BlockSource &region, ::BlockPos const &pos) const
MCAPI void onStateChange (::BlockSource &region, ::BlockPos const &pos, ::Block const &previousBlock, ::BlockChangeContext const &changeSourceContext) const
MCAPI void playerDestroy (::Player &player, ::BlockPos const &pos) const
MCAPI void queuedTick (::BlockSource &region, ::BlockPos const &pos, ::Random &random) const
MCAPI void randomTick (::BlockSource &region, ::BlockPos const &pos, ::Random &random) const
MCAPI void spawnResources (::BlockSource &region, ::BlockPos const &pos, ::IRandom &random, ::ResourceDropsContext const &resourceDropsContext, ::Actor const *actorContext) const
MCAPI::std::string toDebugString () const
MCAPI bool use (::Player &player, ::BlockPos const &pos, uchar face, ::HandSlot handSlot, ::std::optional<::Vec3 > hit) const
MCAPI void * $ctor (ushort data, ::gsl::not_null<::BlockType * > oldBlock)
MCAPI void * $ctor (ushort data, ::gsl::not_null<::BlockType * > oldBlock, ::CompoundTag serId, uint const &runId)

Static Public Member Functions

static LLNDAPI optional_ref< Block const > tryGetFromRegistry (uint runtimeID)
static LLNDAPI optional_ref< Block const > tryGetFromRegistry (uint legacyBlockID, ushort legacyData)
static LLNDAPI optional_ref< Block const > tryGetFromRegistry (HashedString const &name)
static LLNDAPI optional_ref< Block const > tryGetFromRegistry (HashedString const &name, ushort legacyData)
static LLNDAPI optional_ref< Block const > tryGetFromRegistry (HashedString const &name, BlockStatesType const &states)
static LLNDAPI optional_ref< Block const > tryGetFromRegistry (CompoundTag const &nbt)
static MCAPI ::std::string const & BLOCK_DESCRIPTION_PREFIX ()
static MCAPI void ** $vftable ()

Public Attributes

::ll::TypedStorage< 8, 96, ::BlockComponentStorage > mComponents
::ll::TypedStorage< 8, 8, ::gsl::not_null<::BlockType * > > mBlockType
::ll::TypedStorage< 4, 8, ::CachedComponentData > mCachedComponentData
::ll::TypedStorage< 8, 96, ::BlockComponentDirectData > mDirectData
::ll::TypedStorage< 8, 24, ::std::vector<::HashedString > > mTags
::ll::TypedStorage< 8, 24, ::CompoundTag > mSerializationId
::ll::TypedStorage< 8, 8, uint64 > mSerializationIdHash
::ll::TypedStorage< 4, 4, uint > mSerializationIdHashForNetwork
::ll::TypedStorage< 4, 4, uint > mNetworkId
::ll::TypedStorage< 8, 8, ::std::unique_ptr<::IClientBlockData > > mClientData
::ll::TypedStorage< 2, 2, ushort const > mData
::ll::TypedStorage< 1, 1, bool > mHasRuntimeId

Constructor & Destructor Documentation

◆ Block() [1/2]

MCAPI Block::Block ( ushort data,
::gsl::not_null<::BlockType * > oldBlock )
Attention
This function is not yet publicly available. To request access: reference this function in your code and attempt to link. The linker will report the exact symbol name. Submit a access request at https://github.com/LiteLDev/mcapi-requests/issues/new including the full symbol name.

◆ Block() [2/2]

MCAPI Block::Block ( ushort data,
::gsl::not_null<::BlockType * > oldBlock,
::CompoundTag serId,
uint const & runId )
Attention
This function is not yet publicly available. To request access: reference this function in your code and attempt to link. The linker will report the exact symbol name. Submit a access request at https://github.com/LiteLDev/mcapi-requests/issues/new including the full symbol name.

Member Function Documentation

◆ _queueForTickBasedOnComponentConfiguration()

MCAPI void Block::_queueForTickBasedOnComponentConfiguration ( ::BlockSource & region,
::BlockPos const & pos,
::Random & random,
bool placingBlock ) const
Attention
This function is not yet publicly available. To request access: reference this function in your code and attempt to link. The linker will report the exact symbol name. Submit a access request at https://github.com/LiteLDev/mcapi-requests/issues/new including the full symbol name.

◆ addTag()

MCAPI::Block & Block::addTag ( ::HashedString const & tag)
Attention
This function is not yet publicly available. To request access: reference this function in your code and attempt to link. The linker will report the exact symbol name. Submit a access request at https://github.com/LiteLDev/mcapi-requests/issues/new including the full symbol name.

◆ buildDescriptionId()

MCAPI::std::string Block::buildDescriptionId ( ) const
Attention
This function is not yet publicly available. To request access: reference this function in your code and attempt to link. The linker will report the exact symbol name. Submit a access request at https://github.com/LiteLDev/mcapi-requests/issues/new including the full symbol name.

◆ buildSerializationId()

MCAPI void Block::buildSerializationId ( uint latestUpdaterVersion)
Attention
This function is not yet publicly available. To request access: reference this function in your code and attempt to link. The linker will report the exact symbol name. Submit a access request at https://github.com/LiteLDev/mcapi-requests/issues/new including the full symbol name.

◆ canConnect()

MCAPI bool Block::canConnect ( ::Block const & connectionBlock,
uchar toOther ) const
Attention
This function is not yet publicly available. To request access: reference this function in your code and attempt to link. The linker will report the exact symbol name. Submit a access request at https://github.com/LiteLDev/mcapi-requests/issues/new including the full symbol name.

◆ clip()

MCAPI::HitResult Block::clip ( ::BlockPos const & pos,
::Vec3 const & A,
::Vec3 const & B,
::AABB const & aabb ) const
Attention
This function is not yet publicly available. To request access: reference this function in your code and attempt to link. The linker will report the exact symbol name. Submit a access request at https://github.com/LiteLDev/mcapi-requests/issues/new including the full symbol name.

◆ executeItemEvent()

MCAPI void Block::executeItemEvent ( ::ItemStackBase & item,
::std::string const & eventName,
::BlockSource & region,
::BlockPos const & pos,
::Actor & actor,
::HandSlot handSlot ) const
Attention
This function is not yet publicly available. To request access: reference this function in your code and attempt to link. The linker will report the exact symbol name. Submit a access request at https://github.com/LiteLDev/mcapi-requests/issues/new including the full symbol name.

◆ getConnectionID()

MCAPI ::std::optional<::ConnectionID > Block::getConnectionID ( ) const
Attention
This function is not yet publicly available. To request access: reference this function in your code and attempt to link. The linker will report the exact symbol name. Submit a access request at https://github.com/LiteLDev/mcapi-requests/issues/new including the full symbol name.

◆ isPartialBlock()

MCAPI bool Block::isPartialBlock ( ::BlockSource const & region,
::BlockPos const & pos ) const
Attention
This function is not yet publicly available. To request access: reference this function in your code and attempt to link. The linker will report the exact symbol name. Submit a access request at https://github.com/LiteLDev/mcapi-requests/issues/new including the full symbol name.

◆ isPreservingMediumWhenPlaced()

MCAPI bool Block::isPreservingMediumWhenPlaced ( ::Block const & medium) const
Attention
This function is not yet publicly available. To request access: reference this function in your code and attempt to link. The linker will report the exact symbol name. Submit a access request at https://github.com/LiteLDev/mcapi-requests/issues/new including the full symbol name.

◆ isTopPartialBlock()

MCAPI bool Block::isTopPartialBlock ( ::BlockSource const & region,
::BlockPos const & pos ) const
Attention
This function is not yet publicly available. To request access: reference this function in your code and attempt to link. The linker will report the exact symbol name. Submit a access request at https://github.com/LiteLDev/mcapi-requests/issues/new including the full symbol name.

◆ onActorEvent()

MCAPI void Block::onActorEvent ( ::BlockPos const & pos,
::std::string const & eventName,
::Actor & sourceEntity ) const
Attention
This function is not yet publicly available. To request access: reference this function in your code and attempt to link. The linker will report the exact symbol name. Submit a access request at https://github.com/LiteLDev/mcapi-requests/issues/new including the full symbol name.

◆ onActorInternalEvent()

MCAPI void Block::onActorInternalEvent ( ::BlockPos const & pos,
::std::string const & eventName,
::Actor & sourceEntity ) const
Attention
This function is not yet publicly available. To request access: reference this function in your code and attempt to link. The linker will report the exact symbol name. Submit a access request at https://github.com/LiteLDev/mcapi-requests/issues/new including the full symbol name.

◆ onRemove()

MCAPI void Block::onRemove ( ::BlockSource & region,
::BlockPos const & pos ) const
Attention
This function is not yet publicly available. To request access: reference this function in your code and attempt to link. The linker will report the exact symbol name. Submit a access request at https://github.com/LiteLDev/mcapi-requests/issues/new including the full symbol name.

◆ $ctor() [1/2]

MCAPI void * Block::$ctor ( ushort data,
::gsl::not_null<::BlockType * > oldBlock )
Attention
This function is not yet publicly available. To request access: reference this function in your code and attempt to link. The linker will report the exact symbol name. Submit a access request at https://github.com/LiteLDev/mcapi-requests/issues/new including the full symbol name.

◆ $ctor() [2/2]

MCAPI void * Block::$ctor ( ushort data,
::gsl::not_null<::BlockType * > oldBlock,
::CompoundTag serId,
uint const & runId )
Attention
This function is not yet publicly available. To request access: reference this function in your code and attempt to link. The linker will report the exact symbol name. Submit a access request at https://github.com/LiteLDev/mcapi-requests/issues/new including the full symbol name.

◆ $vftable()

MCAPI void ** Block::$vftable ( )
static
Attention
This function is not yet publicly available. To request access: reference this function in your code and attempt to link. The linker will report the exact symbol name. Submit a access request at https://github.com/LiteLDev/mcapi-requests/issues/new including the full symbol name.

The documentation for this class was generated from the following file: