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/util/IDType.h"
13#include "mc/util/TagRegistry.h"
14#include "mc/world/level/biome/glue/BiomeJsonDocumentGlue.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;
31struct BiomeTagIDType;
33namespace SharedTypes::v1_21_120 { struct BiomeJsonDocument; }
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 public:
55 // member variables
56 // NOLINTBEGIN
57 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::SharedTypes::v1_21_120::BiomeJsonDocument>> mBiomeDocument;
58 // NOLINTEND
59 };
60
62 public:
63 // member variables
64 // NOLINTBEGIN
65 ::ll::TypedStorage<4, 4, float> mTemperature;
66 ::ll::TypedStorage<4, 4, float> mDownfall;
67 ::ll::TypedStorage<4, 4, float> mFoliageSnow;
68 // NOLINTEND
69 };
70
71 using BiomeNameLookupMap = ::std::unordered_map<uint64, ::std::unique_ptr<::Biome>>;
72
73public:
74 // member variables
75 // NOLINTBEGIN
76 ::ll::TypedStorage<8, 600, ::WellKnownBiomeTags> mWellKnownBiomeTags;
77 ::ll::TypedStorage<1, 1, bool> mSurfaceBuildersResolved;
78 ::ll::TypedStorage<1, 1, bool> mClientInitialized;
79 ::ll::TypedStorage<8, 64, ::std::unordered_map<uint64, ::std::unique_ptr<::Biome>>> mBiomesByName;
80 ::ll::TypedStorage<
81 8,
82 40,
84 ::gsl::not_null<::Biome*>,
86 ::std::vector<::gsl::not_null<::Biome*>>>>
87 mBiomesById;
88 ::ll::TypedStorage<8, 24, ::std::vector<::std::pair<::BiomeIdType const, ::std::string const&>>>
89 mRemovedBiomesIdAndFullName;
90 ::ll::TypedStorage<4, 4, uint> mNextCustomBiomeId;
91 ::ll::TypedStorage<1, 1, ::std::atomic<bool>> mClosedForRegistration;
92 ::ll::TypedStorage<8, 128, ::TagRegistry<::IDType<::BiomeTagIDType>, ::IDType<::BiomeTagSetIDType>>> mTagRegistry;
93 ::ll::TypedStorage<8, 8, ::Biome*> mEmptyBiome;
94 ::ll::TypedStorage<8, 16, ::Bedrock::PubSub::Subscription> mOnSaveSubscription;
95 ::ll::TypedStorage<8, 16, ::Bedrock::PubSub::Subscription> mOnLevelStorageManagerStartLeaveGameSubscription;
96 ::ll::TypedStorage<8, 24, ::std::vector<::BiomeRegistry::SeasonTextureRowSettings>> mSeasonTextureRowSettings;
97 // NOLINTEND
98
99public:
100 // virtual functions
101 // NOLINTBEGIN
102 virtual ~BiomeRegistry() /*override*/;
103 // NOLINTEND
104
105public:
106 // member functions
107 // NOLINTBEGIN
108 MCAPI BiomeRegistry();
109
110 MCAPI void _initTagRegistry();
111
112 MCAPI ::Biome& _register(::std::string_view name, ::BiomeIdType id);
113
114 MCAPI void _save(::LevelStorage& levelStorage) const;
115
116 MCAPI bool biomeAddTag(::Biome& biome, ::HashedString tag);
117
118 MCAPI bool biomeHasTag(::Biome const&, ::IDType<::BiomeTagIDType> const&) const;
119
120 MCAPI bool biomeHasTag(::Biome const& biome, ::HashedString const& id) const;
121
122 MCAPI bool biomeHasTag(::Biome const& biome, uint64 tagHash) const;
123
124 MCFOLD bool biomeHasTag(::Biome const& biome, ::WellKnownTagID const& tagID) const;
125
126 MCFOLD void forEachBiome(::std::function<void(::Biome const&)> callback) const;
127
128 MCFOLD void forEachNonConstBiome(::std::function<void(::Biome&)> callback);
129
130 MCAPI ::std::vector<::Biome const*> getBiomesInDimension(::DimensionType type) const;
131
132 MCAPI void initServerFromPacks(
133 ::IWorldRegistriesProvider& worldRegistries,
135 ::std::unordered_map<::std::string, ::std::unique_ptr<::BiomeJsonDocumentGlue::ResolvedBiomeData>>&
136 biomeIdToResolvedData
137 );
138
139 MCAPI void
140 initializeWithLevelStorageManagerConnector(::ILevelStorageManagerConnector& levelStorageManagerConnector);
141
142 MCAPI void loadAllBiomeDocuments(
143 ::ResourcePackManager const& loader,
146 ::BaseGameVersion const& baseGameVersion,
147 ::BiomeJsonDocumentGlue& biomeJsonDocumentGlue,
148 ::std::unordered_map<::std::string, ::std::unique_ptr<::BiomeJsonDocumentGlue::ResolvedBiomeData>>&
149 biomeIdToResolvedData
150 );
151
152 MCAPI void loadBiomeData(::LevelStorage const& levelStorage);
153
154 MCAPI void loadBiomeTable(::LevelStorage const& levelStorage);
155
156 MCAPI ::Biome* lookupByHash(::HashedString const& hash);
157
158 MCAPI ::Biome const* lookupById(::BiomeIdType) const;
159
160 MCFOLD ::Biome* lookupById(::BiomeIdType id);
161
162 MCAPI ::Biome const* lookupByName(::std::string const& name) const;
163
164 MCAPI ::Biome* lookupByName(::std::string const& name);
165
166 MCAPI void removeFailedToLoadBiomes();
167
168 MCAPI void saveBiomeTable(::LevelStorage& levelStorage) const;
169 // NOLINTEND
170
171public:
172 // constructor thunks
173 // NOLINTBEGIN
174 MCAPI void* $ctor();
175 // NOLINTEND
176
177public:
178 // destructor thunk
179 // NOLINTBEGIN
180 MCAPI void $dtor();
181 // NOLINTEND
182
183public:
184 // vftables
185 // NOLINTBEGIN
186 MCNAPI static void** $vftable();
187 // NOLINTEND
188};
Definition BaseGameVersion.h:8
Definition EnableNonOwnerReferences.h:7
Definition NonOwnerPointer.h:9
static MCAPI void ** $vftable()
Definition Biome.h:23
Definition Dimension.h:85
Definition HashedString.h:5
Definition ILevelStorageManagerConnector.h:13
Definition IWorldRegistriesProvider.h:25
Definition LevelStorage.h:25
Definition LinkedAssetValidator.h:8
Definition ResourcePackManager.h:29
Definition WellKnownTagID.h:15
Definition flat_set.h:8
Definition BiomeIdType.h:8
Definition BiomeJsonDocumentGlue.h:15
Definition BiomeRegistry.h:47
Definition BiomeRegistry.h:53
Definition BiomeRegistry.h:61
Definition BiomeTagIDType.h:5
Definition BiomeTagSetIDType.h:5
Definition IDType.h:6
Definition BiomeJsonDocument.h:18
Definition ReflectionCtx.h:11
Definition ctx.h:5