40 using BlockStateValueType = std::variant<int, float, bool, std::string>;
41 using BlockStatesType = std::vector<std::pair<std::string, BlockStateValueType>>;
50 [[nodiscard]]
inline std::string
const& getTypeName()
const {
return getLegacyBlock().getTypeName(); }
52 [[nodiscard]]
inline short getBlockItemId()
const {
return getLegacyBlock().getBlockItemId(); }
54 [[nodiscard]]
inline ushort getData()
const {
return mData; }
57 std::optional<T> getState(uint64
id)
const {
58 return mLegacyBlock->getState<T>(id, mData);
62 std::optional<T> getState(
BlockState const& state)
const {
63 return mLegacyBlock->getState<T>(state, mData);
68 return mLegacyBlock->trySetState(
id, value, mData);
73 return mLegacyBlock->trySetState(state, value, mData);
79 ::ll::TypedStorage<8, 104, ::BlockComponentStorage> mComponents;
80 ::ll::TypedStorage<2, 2, ushort const> mData;
81 ::ll::TypedStorage<8, 8, ::gsl::not_null<::BlockLegacy*>> mLegacyBlock;
82 ::ll::TypedStorage<4, 8, ::CachedComponentData> mCachedComponentData;
83 ::ll::TypedStorage<8, 104, ::BlockComponentDirectData> mDirectData;
84 ::ll::TypedStorage<8, 24, ::std::vector<::HashedString>> mTags;
85 ::ll::TypedStorage<8, 24, ::CompoundTag> mSerializationId;
86 ::ll::TypedStorage<8, 8, uint64> mSerializationIdHash;
87 ::ll::TypedStorage<4, 4, uint> mSerializationIdHashForNetwork;
88 ::ll::TypedStorage<4, 4, uint> mNetworkId;
89 ::ll::TypedStorage<1, 1, bool> mHasRuntimeId;
100 virtual ~Block() =
default;
106 MCAPI
Block(ushort data, ::gsl::not_null<::BlockLegacy*> oldBlock);
108 MCAPI
Block(ushort data, ::gsl::not_null<::BlockLegacy*> oldBlock,
::CompoundTag serId, uint
const& runId);
110 MCAPI
void _queueForTickBasedOnComponentConfiguration(
123 MCAPI ::std::string buildDescriptionName()
const;
125 MCAPI
void buildSerializationId(uint latestUpdaterVersion);
127 MCAPI ::std::string buildSerializationIdString()
const;
129 MCAPI
bool canProvideFullSupport(uchar face)
const;
135 MCAPI ::HitResult clip(
140 ::ShapeType shapeType,
144 MCAPI uint computeRawSerializationIdHashForNetwork()
const;
148 MCAPI
void executeItemEvent(
150 ::std::string
const& eventName,
158 MCAPI
bool getCollisionShape(
165 MCAPI ::std::string getDescriptionId()
const;
167 MCAPI ::BlockLegacy
const& getLegacyBlock()
const;
171 MCAPI ::Block
const& getStateFromLegacyData(ushort data)
const;
173 MCAPI
bool hasState(
::BlockState const& stateType)
const;
177 MCAPI
bool isAir()
const;
179 MCAPI
bool isButtonBlock()
const;
181 MCAPI
bool isCropBlock()
const;
183 MCAPI
bool isDoorBlock()
const;
185 MCFOLD
bool isMotionBlockingBlock()
const;
189 MCAPI
bool isPreservingMediumWhenPlaced(
::Block const& medium)
const;
191 MCAPI
bool isSlabBlock()
const;
193 MCAPI
bool isSolidBlockingBlock()
const;
195 MCAPI
bool isSolidBlockingBlockAndNotSignalSource()
const;
199 MCAPI
bool isValidAuxValue(
int value)
const;
222 MCAPI ::Block
const& sanitizeFillBlock()
const;
224 MCAPI
bool shouldRandomTick()
const;
226 MCAPI ::std::string toDebugString()
const;
228 MCAPI
bool use(
::Player& player,
::BlockPos const& pos, uchar face, ::std::optional<::Vec3> hit)
const;
234 MCAPI static ::std::string
const& BLOCK_DESCRIPTION_PREFIX();
240 MCAPI
void* $ctor(ushort data, ::gsl::not_null<::BlockLegacy*> oldBlock);
242 MCAPI
void* $ctor(ushort data, ::gsl::not_null<::BlockLegacy*> oldBlock,
::CompoundTag serId, uint
const& runId);