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
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 // member variables
50 // NOLINTBEGIN
51 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::SharedTypes::v1_21_120::BiomeJsonDocument>> mBiomeDocument;
52 // NOLINTEND
53 };
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
68 public:
69 // BiomeComparator inner types define
70 using is_transparent = void;
71 };
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 // vIndex: 0
103 virtual ~BiomeRegistry() /*override*/;
104 // NOLINTEND
105
106public:
107 // member functions
108 // NOLINTBEGIN
109 MCAPI BiomeRegistry();
110
111 MCAPI void _initTagRegistry();
112
113 MCAPI ::Biome& _register(::std::string_view name, ::BiomeIdType id);
114
115 MCAPI void _save(::LevelStorage& levelStorage) const;
116
117 MCAPI bool biomeHasTag(::Biome const& biome, ::HashedString const& id) const;
118
119 MCAPI bool biomeHasTag(::Biome const& biome, uint64 tagHash) const;
120
121 MCFOLD bool biomeHasTag(::Biome const& biome, ::WellKnownTagID const& tagID) const;
122
123 MCAPI bool biomeHasTag(::Biome const&, ::IDType<::BiomeTagIDType> const&) const;
124
125 MCFOLD void forEachBiome(::std::function<void(::Biome const&)> callback) const;
126
127 MCFOLD void forEachNonConstBiome(::std::function<void(::Biome&)> callback);
128
129 MCAPI ::std::vector<::Biome const*> getBiomesInDimension(::DimensionType type) const;
130
131 MCAPI void initServerFromPacks(
132 ::IWorldRegistriesProvider& worldRegistries,
134 ::std::unordered_map<::std::string, ::std::unique_ptr<::BiomeJsonDocumentGlue::ResolvedBiomeData>>&
135 biomeIdToResolvedData
136 );
137
138 MCAPI void
139 initializeWithLevelStorageManagerConnector(::ILevelStorageManagerConnector& levelStorageManagerConnector);
140
141 MCAPI void loadAllBiomeDocuments(
142 ::ResourcePackManager const& loader,
145 ::BaseGameVersion const& baseGameVersion,
146 ::BiomeJsonDocumentGlue& biomeJsonDocumentGlue,
147 ::std::unordered_map<::std::string, ::std::unique_ptr<::BiomeJsonDocumentGlue::ResolvedBiomeData>>&
148 biomeIdToResolvedData
149 );
150
151 MCAPI void loadBiomeData(::LevelStorage const& levelStorage);
152
153 MCAPI void loadBiomeTable(::LevelStorage const& levelStorage);
154
155 MCAPI ::Biome* lookupByHash(::HashedString const& hash);
156
157 MCAPI ::Biome const* lookupById(::BiomeIdType) const;
158
159 MCFOLD ::Biome* lookupById(::BiomeIdType id);
160
161 MCAPI ::Biome const* lookupByName(::std::string const& name) const;
162
163 MCAPI ::Biome* lookupByName(::std::string const& name);
164
165 MCAPI void removeFailedToLoadBiomes();
166
167 MCAPI void saveBiomeTable(::LevelStorage& levelStorage) const;
168 // NOLINTEND
169
170public:
171 // constructor thunks
172 // NOLINTBEGIN
173 MCAPI void* $ctor();
174 // NOLINTEND
175
176public:
177 // destructor thunk
178 // NOLINTBEGIN
179 MCAPI void $dtor();
180 // NOLINTEND
181
182public:
183 // vftables
184 // NOLINTBEGIN
185 MCNAPI static void** $vftable();
186 // NOLINTEND
187};
Definition AutomaticID.h:6
Definition BaseGameVersion.h:8
Definition EnableNonOwnerReferences.h:7
Definition NonOwnerPointer.h:9
Definition BiomeRegistry.h:37
static MCAPI void ** $vftable()
Definition Biome.h:23
Definition Dimension.h:83
Definition HashedString.h:5
Definition ILevelStorageManagerConnector.h:13
Definition IWorldRegistriesProvider.h:25
Definition LevelStorage.h:25
Definition LinkedAssetValidator.h:8
Definition ResourcePackManager.h:24
Definition WellKnownTagID.h:15
Definition flat_set.h:8
Definition BiomeIdType.h:8
Definition BiomeJsonDocumentGlue.h:15
Definition BiomeRegistry.h:67
Definition BiomeRegistry.h:47
Definition BiomeRegistry.h:55
Definition BiomeTagIDType.h:5
Definition BiomeTagSetIDType.h:5
Definition IDType.h:6
Definition ReflectionCtx.h:11
Definition ctx.h:5