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>>>;
138 using BlockComplexAliasPostSplitBlockNamesLookupMap = ::entt::dense_map<uint64, uint64>;
140 using BlockNameHashToHashedStringMap = ::entt::dense_map<uint64, ::HashedString>;
146 ::ll::TypedStorage<8, 8, ::BlockType const&> mAirBlock;
156 enum class LookupByNameImplResolve :
int {
164 ::ll::TypedStorage<8, 16, ::std::map<::HashedString, ::SharedPtr<::BlockType>>> mBlockLookupMap;
165 ::ll::TypedStorage<8, 64, ::std::unordered_map<::HashedString, ::HashedString>> mBlockAliasLookupMap;
166 ::ll::TypedStorage<8, 72, ::entt::dense_map<::HashedString, ::BlockTypeRegistry::BlockComplexAliasContent>>
167 mBlockComplexAliasLookupMap;
168 ::ll::TypedStorage<8, 24, ::std::vector<::std::vector<::std::reference_wrapper<::HashedString const>>>>
169 mBlockComplexAliasPostSplitBlockNamesList;
170 ::ll::TypedStorage<8, 72, ::entt::dense_map<uint64, uint64>> mBlockComplexAliasPostSplitBlockNamesLookupMap;
171 ::ll::TypedStorage<8, 16, ::std::map<::HashedString, ::HashedString>> mBlockComplexAliasPreSplitBlockNamesLookupMap;
172 ::ll::TypedStorage<8, 16, ::std::set<::std::string>> mKnownNamespaces;
173 ::ll::TypedStorage<8, 72, ::entt::dense_map<uint64, ::HashedString>> mBlockNameHashToStringMap;
174 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::BlockTypeRegistry::DirectAccessBlocks>> mDirectAccessBlocks;
175 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::BlockTypeRegistryRWLock>> mRWLock;
183 MCAPI ::BlockTypeRegistryReadLock _lockAgainstRegistryModifications()
const;
185 MCAPI ::BlockTypeRegistryModificationsLock _lockForRegistryModifications()
const;
187 MCAPI ::BlockTypeRegistry::LookupByNameImplReturnType _lookupByNameImpl(
190 ::BlockTypeRegistry::LookupByNameImplResolve resolve,
191 bool logNotFound =
false
194 MCAPI
void checkBlockPermutationCap()
const;
196 MCAPI uint64 computeBlockTypeRegistryChecksum(
::BaseGameVersion const& worldBaseGameVersion)
const;
198 MCAPI
void finalizeBlockComponentStorage();
204 MCAPI ::HashedString
const& getBlockNameFromNameHash(uint64 hash)
const;
206 MCAPI ::std::vector<::std::reference_wrapper<::HashedString const>>
const&
207 getComplexAliasPostSplitBlockNames(
::HashedString const& oldName)
const;
209 MCAPI ::Block
const& getDefaultBlockState(
::HashedString const& name,
bool logNotFound =
false)
const;
211 MCAPI ::BlockTypeRegistry::DirectAccessBlocks
const& getDirectAccessBlocks()
const;
213 MCAPI
void initHardCodedBlockComponents(
::Experiments const& experiments);
215 MCAPI
bool isComplexAliasBlock(
::HashedString const& blockName)
const;
217 MCAPI ::WeakPtr<::BlockType> lookupByName(
::HashedString const& name,
bool logNotFound =
false)
const;
219 MCAPI
void prepareBlocks(uint latestUpdaterVersion);
223 MCAPI
void registerComplexAlias(
225 ::std::function<
::Block const*(
int)> callback,
226 ::std::vector<::std::reference_wrapper<::HashedString const>>
const& postSplitBlockNames,
233 MCAPI
void setupDirectAccessBlocks();
235 MCAPI
void setupVoxelShapeRegistryAccessOnAllBlocks(
236 ::std::shared_ptr<::VoxelShapes::VoxelShapeRegistry>
const& voxelShapeRegistry
241 MCAPI
void unregisterBlocks();
249 MCAPI static ::BlockTypeRegistry& get();
251 MCAPI static ::Bedrock::NotNullNonOwnerPtr<::BlockTypeRegistry> getNonOwner();
257 MCAPI static ::Bedrock::Owner<::BlockTypeRegistry>& mBlockTypeRegistry();
Definition BlockTypeRegistry.h:65