39 using BlockLookupMap = ::std::map<::HashedString, ::SharedPtr<::BlockType>>;
41 using BlockAliasLookupMap = ::std::unordered_map<::HashedString, ::HashedString>;
46 : stateName(stateName),
63 using BlockComplexAliasCallback = ::std::function<
::Block const*(int)>;
69 ::ll::TypedStorage<8, 64, ::std::function<
::Block const*(int)>> mCallback;
70 ::ll::TypedStorage<8, 32, ::BaseGameVersion> mMinRequiredVersion;
71 ::ll::TypedStorage<8, 24, ::SemVersion> mFlattenedInBlocksJsonVersion;
72 ::ll::TypedStorage<4, 4, int> mStartVariant;
84 MCAPI ::Block
const* operator()(
int data)
const;
98 using BlockComplexAliasLookupMap = ::entt::dense_map<::HashedString, ::BlockTypeRegistry::BlockComplexAliasContent>;
104 ::ll::TypedStorage<8, 8, ::WeakPtr<::BlockType const>> mBlockType;
105 ::ll::TypedStorage<8, 8, ::Block const*> mBlock;
125 MCAPI
void* $ctor(
::Block const* block,
bool resolveBlockType);
133 using BlockComplexAliasPostSplitBlockNames = ::std::vector<::std::reference_wrapper<::HashedString const>>;
135 using BlockComplexAliasPostSplitBlockNamesList =
136 ::std::vector<::std::vector<::std::reference_wrapper<::HashedString const>>>;
137 using BlockComplexAliasPostSplitBlockNamesLookupMap = ::entt::dense_map<uint64, uint64>;
139 using BlockNameHashToHashedStringMap = ::entt::dense_map<uint64, ::HashedString>;
145 ::ll::TypedStorage<8, 8, ::BlockType const&> mAirBlock;
155 enum class LookupByNameImplResolve :
int {
163 ::ll::TypedStorage<8, 16, ::std::map<::HashedString, ::SharedPtr<::BlockType>>> mBlockLookupMap;
164 ::ll::TypedStorage<8, 64, ::std::unordered_map<::HashedString, ::HashedString>> mBlockAliasLookupMap;
165 ::ll::TypedStorage<8, 72, ::entt::dense_map<::HashedString, ::BlockTypeRegistry::BlockComplexAliasContent>>
166 mBlockComplexAliasLookupMap;
167 ::ll::TypedStorage<8, 24, ::std::vector<::std::vector<::std::reference_wrapper<::HashedString const>>>>
168 mBlockComplexAliasPostSplitBlockNamesList;
169 ::ll::TypedStorage<8, 72, ::entt::dense_map<uint64, uint64>> mBlockComplexAliasPostSplitBlockNamesLookupMap;
170 ::ll::TypedStorage<8, 16, ::std::map<::HashedString, ::HashedString>> mBlockComplexAliasPreSplitBlockNamesLookupMap;
171 ::ll::TypedStorage<8, 16, ::std::set<::std::string>> mKnownNamespaces;
172 ::ll::TypedStorage<8, 72, ::entt::dense_map<uint64, ::HashedString>> mBlockNameHashToStringMap;
173 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::BlockTypeRegistry::DirectAccessBlocks>> mDirectAccessBlocks;
174 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::BlockTypeRegistryRWLock>> mRWLock;
182 MCAPI ::BlockTypeRegistryReadLock _lockAgainstRegistryModifications()
const;
184 MCAPI ::BlockTypeRegistryModificationsLock _lockForRegistryModifications()
const;
186 MCAPI ::BlockTypeRegistry::LookupByNameImplReturnType _lookupByNameImpl(
189 ::BlockTypeRegistry::LookupByNameImplResolve resolve,
190 bool logNotFound =
false
193 MCAPI
void checkBlockPermutationCap()
const;
195 MCAPI uint64 computeBlockTypeRegistryChecksum(
::BaseGameVersion const& worldBaseGameVersion)
const;
197 MCAPI
void finalizeBlockComponentStorage();
203 MCAPI ::HashedString
const& getBlockNameFromNameHash(uint64 hash)
const;
205 MCAPI ::std::vector<::std::reference_wrapper<::HashedString const>>
const&
206 getComplexAliasPostSplitBlockNames(
::HashedString const& oldName)
const;
208 MCAPI ::Block
const& getDefaultBlockState(
::HashedString const& name,
bool logNotFound =
false)
const;
210 MCAPI ::BlockTypeRegistry::DirectAccessBlocks
const& getDirectAccessBlocks()
const;
212 MCAPI
void initHardCodedBlockComponents(
::Experiments const& experiments);
214 MCAPI
bool isComplexAliasBlock(
::HashedString const& blockName)
const;
216 MCAPI ::WeakPtr<::BlockType> lookupByName(
::HashedString const& name,
bool logNotFound =
false)
const;
218 MCAPI
void prepareBlocks(uint latestUpdaterVersion);
222 MCAPI
void registerComplexAlias(
224 ::std::function<
::Block const*(
int)> callback,
225 ::std::vector<::std::reference_wrapper<::HashedString const>>
const& postSplitBlockNames,
232 MCAPI
void setupDirectAccessBlocks();
234 MCAPI
void setupVoxelShapeRegistryAccessOnAllBlocks(
235 ::std::shared_ptr<::VoxelShapes::VoxelShapeRegistry>
const& voxelShapeRegistry
240 MCAPI
void unregisterBlocks();
248 MCAPI static ::BlockTypeRegistry& get();
250 MCAPI static ::Bedrock::NotNullNonOwnerPtr<::BlockTypeRegistry> getNonOwner();
256 MCAPI static ::Bedrock::Owner<::BlockTypeRegistry>& mBlockTypeRegistry();
Definition BlockTypeRegistry.h:65