21class BlockDescriptor {
31 enum class CompareType :
int {
42 ::ll::TypedStorage<8, 8, ::BlockDescriptor&> mBlockDescriptor;
47 ResolveHelper& operator=(ResolveHelper
const&);
48 ResolveHelper(ResolveHelper
const&);
54 MCAPI
void resolve(
bool logInvalidBlocks);
62 ::ll::TypedStorage<8, 8, ::gsl::not_null<::BlockState const*>> mBlockState;
63 ::ll::TypedStorage<4, 4, int> mValue;
71 ::ll::TypedStorage<8, 48, ::HashedString> mName;
72 ::ll::TypedStorage<8, 40, ::SharedTypes::Legacy::BlockDescriptor::Compound> mState;
84 MCAPI State(
::HashedString name, ::std::string
const& stringState);
94 MCAPI
void* $ctor(
::HashedString name, ::std::string
const& stringState);
109 ::ll::TypedStorage<8, 8, ::BlockDescriptor::ResolveHelper> mResolveHelper;
110 ::ll::TypedStorage<8, 48, ::HashedString> mBlockName;
111 ::ll::TypedStorage<1, 1, bool> mIsComplexAlias;
112 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::ExpressionNode>> mTags;
113 ::ll::TypedStorage<8, 24, ::std::vector<::BlockDescriptor::State>> mRawStates;
114 ::ll::TypedStorage<8, 24, ::std::vector<::BlockDescriptor::ResolvedState>> mResolvedStates;
115 ::ll::TypedStorage<4, 4, ::BlockDescriptor::CompareType> mCompareType;
116 ::ll::TypedStorage<1, 1, bool> mContentLogOnError;
117 ::ll::TypedStorage<8, 8, ::Block const*> mBlock;
118 ::ll::TypedStorage<1, 1, bool> mValid;
119 ::ll::TypedStorage<1, 1, bool> mIsDeferred;
120 ::ll::TypedStorage<8, 24, ::SpinLockImpl> mLock;
124 static bool anyMatch(::std::vector<::BlockDescriptor>
const& blockDescriptors,
::Block const& block) {
125 return std::ranges::any_of(blockDescriptors, [&block](
auto&& des) {
return des.matches(block); });
135 MCAPI
explicit BlockDescriptor(::SharedTypes::Legacy::BlockDescriptor desc);
137 MCAPI
explicit BlockDescriptor(::HashedString
const& fullName);
139 MCAPI BlockDescriptor(::BlockDescriptor&& rhs);
141 MCAPI BlockDescriptor(::BlockDescriptor
const& rhs);
143 MCAPI BlockDescriptor(::std::string
const& name, ::std::vector<::BlockDescriptor::State>&& states);
145 MCAPI
bool _anyTagsMatch(::Block
const& block)
const;
147 MCAPI
bool _statesMatch(::Block
const& block)
const;
149 MCAPI ::Block
const& getBlockOrUnknownBlock()
const;
151 MCAPI ::BlockDescriptor::CompareType
const& getCompareType()
const;
153 MCAPI ::std::string
const& getFullName()
const;
155 MCAPI
bool isValid()
const;
157 MCAPI
bool matches(::Block
const& block)
const;
159 MCAPI
bool matches(::BlockDescriptor
const& otherDescriptor)
const;
161 MCAPI
void operator=(::BlockDescriptor&& rhs);
163 MCAPI
void operator=(::BlockDescriptor
const& rhs);
165 MCAPI ::std::unique_ptr<::CompoundTag> toCompoundTag()
const;
167 MCAPI ::Block
const* tryGetBlock()
const;
169 MCAPI ::Block
const* tryGetBlockNoLogging()
const;
171 MCAPI ~BlockDescriptor();
177 MCAPI
static void bindType(::cereal::ReflectionCtx& ctx);
179 MCAPI static ::BlockDescriptor fromCompoundTag(::CompoundTag
const& tag);
181 MCAPI static ::BlockDescriptor fromTagExpression(::std::string
const& tagExpression, ::MolangVersion molangVersion);
183 MCAPI static ::SharedTypes::Legacy::BlockDescriptor toSharedTypes(::BlockDescriptor
const& instance);
189 MCAPI static ::std::add_lvalue_reference_t<char const[]> JSON_NAME_FIELD();
191 MCAPI static ::std::add_lvalue_reference_t<char const[]> JSON_STATES_FIELD();
193 MCAPI static ::std::add_lvalue_reference_t<char const[]> JSON_TAGS_FIELD();
199 MCAPI
void* $ctor(::SharedTypes::Legacy::BlockDescriptor desc);
201 MCAPI
void* $ctor(::HashedString
const& fullName);
203 MCAPI
void* $ctor(::BlockDescriptor&& rhs);
205 MCAPI
void* $ctor(::BlockDescriptor
const& rhs);
207 MCAPI
void* $ctor(::std::string
const& name, ::std::vector<::BlockDescriptor::State>&& states);