38 using BlockStateValueType = std::variant<int, float, bool, std::string>;
39 using BlockStatesType = std::vector<std::pair<std::string, BlockStateValueType>>;
48 [[nodiscard]]
inline std::string
const& getTypeName()
const {
return getLegacyBlock().getTypeName(); }
50 [[nodiscard]]
inline short getBlockItemId()
const {
return getLegacyBlock().getBlockItemId(); }
52 [[nodiscard]]
inline ushort getData()
const {
return mData; }
55 std::optional<T> getState(uint64
id)
const {
56 return mLegacyBlock->getState<T>(id, mData);
60 std::optional<T> getState(
BlockState const& state)
const {
61 return mLegacyBlock->getState<T>(state, mData);
66 return mLegacyBlock->trySetState(
id, value, mData);
71 return mLegacyBlock->trySetState(state, value, mData);
77 ::ll::TypedStorage<8, 104, ::BlockComponentStorage> mComponents;
78 ::ll::TypedStorage<2, 2, ushort const> mData;
79 ::ll::TypedStorage<8, 8, ::gsl::not_null<::BlockLegacy*>> mLegacyBlock;
80 ::ll::TypedStorage<4, 8, ::CachedComponentData> mCachedComponentData;
81 ::ll::TypedStorage<8, 104, ::BlockComponentDirectData> mDirectData;
82 ::ll::TypedStorage<8, 24, ::std::vector<::HashedString>> mTags;
83 ::ll::TypedStorage<8, 24, ::CompoundTag> mSerializationId;
84 ::ll::TypedStorage<8, 8, uint64> mSerializationIdHash;
85 ::ll::TypedStorage<4, 4, uint> mSerializationIdHashForNetwork;
86 ::ll::TypedStorage<4, 4, uint> mNetworkId;
87 ::ll::TypedStorage<1, 1, bool> mHasRuntimeId;
94 virtual ~Block() =
default;
100 MCAPI
Block(ushort data, ::gsl::not_null<::BlockLegacy*> oldBlock);
102 MCAPI
Block(ushort data, ::gsl::not_null<::BlockLegacy*> oldBlock,
::CompoundTag serId, uint
const& runId);
104 MCAPI
void _queueForTickBasedOnComponentConfiguration(
117 MCAPI ::std::string buildDescriptionName()
const;
119 MCAPI
void buildSerializationId(uint latestUpdaterVersion);
121 MCAPI ::std::string buildSerializationIdString()
const;
123 MCAPI
bool canProvideFullSupport(uchar face)
const;
129 MCAPI ::HitResult clip(
134 ::ShapeType shapeType,
138 MCAPI uint computeRawSerializationIdHashForNetwork()
const;
142 MCAPI
void executeItemEvent(
144 ::std::string
const& eventName,
150 MCAPI
bool getCollisionShape(
157 MCAPI ::std::string getDescriptionId()
const;
159 MCAPI ::BlockLegacy
const& getLegacyBlock()
const;
163 MCAPI ::Block
const& getStateFromLegacyData(ushort data)
const;
165 MCAPI
bool hasState(
::BlockState const& stateType)
const;
169 MCAPI
bool isAir()
const;
171 MCAPI
bool isButtonBlock()
const;
173 MCAPI
bool isCropBlock()
const;
175 MCAPI
bool isDoorBlock()
const;
177 MCFOLD
bool isMotionBlockingBlock()
const;
181 MCAPI
bool isPreservingMediumWhenPlaced(
::Block const& medium)
const;
183 MCAPI
bool isSlabBlock()
const;
185 MCAPI
bool isSolidBlockingBlock()
const;
187 MCAPI
bool isSolidBlockingBlockAndNotSignalSource()
const;
191 MCAPI
bool isValidAuxValue(
int value)
const;
214 MCAPI ::Block
const& sanitizeFillBlock()
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<::BlockLegacy*> oldBlock);
234 MCAPI
void* $ctor(ushort data, ::gsl::not_null<::BlockLegacy*> oldBlock,
::CompoundTag serId, uint
const& runId);
246 MCAPI
static void** $vftable();