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