39 using BlockStateValueType = std::variant<int, float, bool, std::string>;
40 using BlockStatesType = std::vector<std::pair<std::string, BlockStateValueType>>;
47 tryGetFromRegistry(
HashedString const& name, BlockStatesType
const& states);
54 LLNDAPI
bool isAir()
const;
56 [[nodiscard]]
BlockType const& getBlockType()
const {
return *mBlockType; }
58 [[nodiscard]] std::string
const& getTypeName()
const {
return getBlockType().getTypeName(); }
60 [[nodiscard]]
short getBlockItemId()
const {
return getBlockType().getBlockItemId(); }
62 [[nodiscard]] ushort getData()
const {
return mData; }
65 std::optional<T> getState(uint64
id)
const {
66 return mBlockType->getState<T>(id, mData);
70 std::optional<T> getState(
BlockState const& state)
const {
71 return mBlockType->getState<T>(state, mData);
76 return mBlockType->trySetState(
id, value, mData);
81 return mBlockType->trySetState(state, value, mData);
84 bool operator==(
Block const& other)
const {
return mSerializationIdHash == other.mSerializationIdHash; }
89 ::ll::TypedStorage<8, 104, ::BlockComponentStorage> mComponents;
90 ::ll::TypedStorage<2, 2, ushort const> mData;
91 ::ll::TypedStorage<8, 8, ::gsl::not_null<::BlockType*>> mBlockType;
92 ::ll::TypedStorage<4, 8, ::CachedComponentData> mCachedComponentData;
93 ::ll::TypedStorage<8, 96, ::BlockComponentDirectData> mDirectData;
94 ::ll::TypedStorage<8, 24, ::std::vector<::HashedString>> mTags;
95 ::ll::TypedStorage<8, 24, ::CompoundTag> mSerializationId;
96 ::ll::TypedStorage<8, 8, uint64> mSerializationIdHash;
97 ::ll::TypedStorage<4, 4, uint> mSerializationIdHashForNetwork;
98 ::ll::TypedStorage<4, 4, uint> mNetworkId;
99 ::ll::TypedStorage<1, 1, bool> mHasRuntimeId;
110 virtual ~Block() =
default;
116 MCAPI
Block(ushort data, ::gsl::not_null<::BlockType*> oldBlock);
118 MCAPI
Block(ushort data, ::gsl::not_null<::BlockType*> oldBlock,
::CompoundTag serId, uint
const& runId);
120 MCAPI
bool _isSolid()
const;
122 MCAPI
void _queueForTickBasedOnComponentConfiguration(
137 MCAPI ::std::string buildDescriptionName()
const;
139 MCAPI
void buildSerializationId(uint latestUpdaterVersion);
141 MCAPI
bool canProvideFullSupport(uchar face)
const;
147 MCAPI ::HitResult clip(
152 ::ShapeType shapeType,
156 MCAPI uint computeRawSerializationIdHashForNetwork()
const;
160 MCAPI ::Block
const& copyStates(
::Block const& fromBlock)
const;
162 MCAPI
void executeItemEvent(
164 ::std::string
const& eventName,
172 MCAPI
bool getCollisionShape(
179 MCAPI ::std::string getDescriptionId()
const;
181 MCAPI ::Block
const& getStateFromLegacyData(ushort data)
const;
185 MCAPI
bool hasState(
::BlockState const& stateType)
const;
191 MCAPI
bool isPreservingMediumWhenPlaced(
::Block const& medium)
const;
193 MCAPI
bool isSolidBlockingBlockAndNotSignalSource()
const;
216 MCAPI
bool shouldRandomTick()
const;
218 MCAPI ::std::string toDebugString()
const;
220 MCAPI
bool use(
::Player& player,
::BlockPos const& pos, uchar face, ::std::optional<::Vec3> hit)
const;
226 MCAPI static ::std::string
const& BLOCK_DESCRIPTION_PREFIX();
232 MCAPI
void* $ctor(ushort data, ::gsl::not_null<::BlockType*> oldBlock);
234 MCAPI
void* $ctor(ushort data, ::gsl::not_null<::BlockType*> oldBlock,
::CompoundTag serId, uint
const& runId);
240 MCAPI
static void** $vftable();