LeviLamina
Loading...
Searching...
No Matches
BiomeRegistry.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4#include "mc/world/level/biome/components/vanilla/VanillaBiomeTypes.h"
5
6// auto generated inclusion list
7#include "mc/deps/core/utility/EnableNonOwnerReferences.h"
8#include "mc/deps/core/utility/NonOwnerPointer.h"
9#include "mc/deps/core/utility/pub_sub/Subscription.h"
10#include "mc/platform/brstd/flat_set.h"
11#include "mc/platform/brstd/function_ref.h"
12#include "mc/util/IDType.h"
13#include "mc/util/TagRegistry.h"
14#include "mc/world/level/biome/registry/WellKnownBiomeTags.h"
15
16// auto generated forward declare list
17// clang-format off
18class BaseGameVersion;
19class Biome;
20class HashedString;
23class LevelStorage;
26class WellKnownTagID;
27struct BiomeHashType;
28struct BiomeIdType;
31struct BiomeTagIDType;
33struct DimensionType;
34namespace cereal { struct ReflectionCtx; }
35// clang-format on
36
37class BiomeRegistry : public ::Bedrock::EnableNonOwnerReferences {
38public:
39 // BiomeRegistry inner types declare
40 // clang-format off
41 struct BiomeComparator;
44 // clang-format on
45
46 // BiomeRegistry inner types define
48 public:
49 // BiomeComparator inner types define
50 using is_transparent = void;
51 };
52
54
56 public:
57 // member variables
58 // NOLINTBEGIN
59 ::ll::TypedStorage<4, 4, float> mTemperature;
60 ::ll::TypedStorage<4, 4, float> mDownfall;
61 ::ll::TypedStorage<4, 4, float> mFoliageSnow;
62 // NOLINTEND
63 };
64
65 using BiomeNameLookupMap = ::std::unordered_map<uint64, ::std::unique_ptr<::Biome>>;
66
67public:
68 // member variables
69 // NOLINTBEGIN
70 ::ll::TypedStorage<8, 128, ::TagRegistry<::IDType<::BiomeTagIDType>, ::IDType<::BiomeTagSetIDType>>> mTagRegistry;
71 ::ll::TypedStorage<8, 720, ::WellKnownBiomeTags const> mWellKnownBiomeTags;
72 ::ll::TypedStorage<1, 1, bool> mSurfaceBuildersResolved;
73 ::ll::TypedStorage<1, 1, bool> mClientInitialized;
74 ::ll::TypedStorage<8, 64, ::std::unordered_map<uint64, ::std::unique_ptr<::Biome>>> mBiomesByName;
75 ::ll::TypedStorage<
76 8,
77 24,
79 ::gsl::not_null<::Biome*>,
81 ::std::vector<::gsl::not_null<::Biome*>>>>
82 mBiomesById;
83 ::ll::TypedStorage<8, 24, ::std::vector<::std::pair<::BiomeIdType const, ::std::string const&>>>
84 mRemovedBiomesIdAndFullName;
85 ::ll::TypedStorage<4, 4, uint> mNextCustomBiomeId;
86 ::ll::TypedStorage<1, 1, ::std::atomic<bool>> mClosedForRegistration;
87 ::ll::TypedStorage<8, 8, ::Biome*> mEmptyBiome;
88 ::ll::TypedStorage<8, 16, ::Bedrock::PubSub::Subscription> mOnSaveSubscription;
89 ::ll::TypedStorage<8, 16, ::Bedrock::PubSub::Subscription> mOnLevelStorageManagerStartLeaveGameSubscription;
90 ::ll::TypedStorage<8, 24, ::std::vector<::BiomeRegistry::SeasonTextureRowSettings>> mSeasonTextureRowSettings;
91 // NOLINTEND
92
93public:
94 // virtual functions
95 // NOLINTBEGIN
96 virtual ~BiomeRegistry() /*override*/;
97 // NOLINTEND
98
99public:
100 // member functions
101 // NOLINTBEGIN
102 MCAPI BiomeRegistry();
103
104 MCAPI void _forEachExistingBiomeAndRemovedBiome(
105 ::brstd::function_ref<void(::BiomeIdType, ::std::string const&)> callback
106 ) const;
107
108 MCAPI ::Biome& _register(::std::string_view name, ::BiomeIdType id);
109
110 MCAPI void _save(::LevelStorage& levelStorage) const;
111
112#ifdef LL_PLAT_C
113 MCAPI
114 uint64 assignSeasonTextureRow(::BiomeRegistry::SeasonTextureRowSettings const& desiredSettings, uint64 maxSize);
115#endif
116
117 MCAPI bool biomeAddTag(::Biome& biome, ::HashedString tag);
118
119 MCAPI ::std::vector<::std::string> const biomeGetTags(::Biome const& biome) const;
120
121 MCAPI bool biomeHasTag(::Biome const& biome, ::HashedString const& id) const;
122
123 MCAPI bool biomeHasTag(::Biome const& biome, uint64 tagHash) const;
124
125 MCFOLD bool biomeHasTag(::Biome const& biome, ::IDType<::BiomeTagIDType> const& tagID) const;
126
127 MCFOLD bool biomeHasTag(::Biome const& biome, ::WellKnownTagID const& tagID) const;
128
129 MCFOLD void forEachBiome(::brstd::function_ref<void(::Biome const&)> callback) const;
130
131 MCFOLD void forEachNonConstBiome(::brstd::function_ref<void(::Biome&)> callback);
132
133 MCAPI ::std::vector<::Biome const*> getBiomesInDimension(::DimensionType type) const;
134
135#ifdef LL_PLAT_C
136 MCFOLD ::std::vector<::BiomeRegistry::SeasonTextureRowSettings> const& getSeasonTextureRowSettings() const;
137
138 MCFOLD ::std::vector<::BiomeRegistry::SeasonTextureRowSettings>& getSeasonTextureRowSettings();
139#endif
140
141 MCFOLD ::TagRegistry<::IDType<::BiomeTagIDType>, ::IDType<::BiomeTagSetIDType>> const& getTagRegistry() const;
142
143#ifdef LL_PLAT_C
144 MCFOLD ::TagRegistry<::IDType<::BiomeTagIDType>, ::IDType<::BiomeTagSetIDType>>& getTagRegistry();
145#endif
146
147 MCAPI void initServerFromPacks(
148 ::IWorldRegistriesProvider& worldRegistries,
150 ::std::unordered_map<::std::string, ::std::unique_ptr<::BiomeJsonDocumentGlueResolvedBiomeData>>&
151 biomeIdToResolvedData
152 );
153
154 MCAPI void
155 initializeWithLevelStorageManagerConnector(::ILevelStorageManagerConnector& levelStorageManagerConnector);
156
157 MCAPI bool isRegistrationFinished() const;
158
159 MCAPI void loadAllBiomeDocuments(
160 ::ResourcePackManager const& loader,
163 ::BaseGameVersion const& baseGameVersion,
164 ::BiomeJsonDocumentGlue& biomeJsonDocumentGlue,
165 ::std::unordered_map<::std::string, ::std::unique_ptr<::BiomeJsonDocumentGlueResolvedBiomeData>>&
166 biomeIdToResolvedData,
167 bool betaApis
168 );
169
170 MCAPI void loadBiomeData(::LevelStorage const& levelStorage);
171
172 MCAPI void loadBiomeTable(::LevelStorage const& levelStorage);
173
174#ifdef LL_PLAT_C
175 MCAPI ::Biome const* lookupByHash(::HashedString const& hash) const;
176#endif
177
178 MCFOLD ::Biome const* lookupByHashId(::BiomeHashType id) const;
179
180 MCFOLD ::Biome* lookupByHashId(::BiomeHashType id);
181
182 MCFOLD ::Biome const* lookupById(::BiomeIdType id) const;
183
184 MCFOLD ::Biome* lookupById(::BiomeIdType id);
185
186 MCFOLD ::Biome const* lookupByName(::std::string const& name) const;
187
188 MCFOLD ::Biome* lookupByName(::std::string const& name);
189
190 MCAPI ::Biome& registerBiomeWithExplicitId(::std::string_view name, ::BiomeIdType id);
191
192 MCAPI ::Biome& registerCustomBiome(::std::string_view name);
193
194 MCAPI void registrationFinished();
195
196 MCAPI void removeFailedToLoadBiomes();
197
198 MCAPI void saveBiomeTable(::LevelStorage& levelStorage) const;
199 // NOLINTEND
200
201public:
202 // constructor thunks
203 // NOLINTBEGIN
204 MCAPI void* $ctor();
205 // NOLINTEND
206
207public:
208 // destructor thunk
209 // NOLINTBEGIN
210 MCAPI void $dtor();
211 // NOLINTEND
212
213public:
214 // vftables
215 // NOLINTBEGIN
216 MCNAPI static void** $vftable();
217 // NOLINTEND
218};
Definition BaseGameVersion.h:13
Definition EnableNonOwnerReferences.h:7
Definition NonOwnerPointer.h:9
static MCAPI void ** $vftable()
Definition Biome.h:24
Definition HashedString.h:5
Definition ILevelStorageManagerConnector.h:13
Definition IWorldRegistriesProvider.h:25
Definition LevelStorage.h:26
Definition LinkedAssetValidator.h:8
Definition ResourcePackManager.h:35
Definition WellKnownTagID.h:15
Definition flat_set.h:10
Definition function_ref.h:60
Definition BiomeHashType.h:8
Definition BiomeIdType.h:8
Definition BiomeJsonDocumentGlueResolvedBiomeData.h:10
Definition BiomeJsonDocumentGlue.h:12
Definition BiomeRegistry.h:47
Definition BiomeRegistry.h:53
Definition BiomeRegistry.h:55
Definition BiomeTagIDType.h:5
Definition BiomeTagSetIDType.h:5
Definition DimensionType.h:5
Definition IDType.h:6
Definition ReflectionCtx.h:11
Definition ctx.h:5