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