LeviLamina
Loading...
Searching...
No Matches
StructurePoolElement.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/utility/NonOwnerPointer.h"
7#include "mc/platform/brstd/once_flag.h"
8#include "mc/util/Rotation.h"
9#include "mc/world/level/levelgen/structure/PostProcessSettings.h"
10#include "mc/world/level/levelgen/structure/Projection.h"
11#include "mc/world/level/levelgen/structure/structurepools/JigsawBlockInfo.h"
12#include "mc/world/level/levelgen/structure/structurepools/JigsawReplacement.h"
13#include "mc/world/level/levelgen/structure/structurepools/StructurePoolElementSettings.h"
14#include "mc/world/level/levelgen/structure/structurepools/StructurePoolElementType.h"
15#include "mc/world/level/levelgen/structure/structurepools/jigsaw_structure_utils/StructureElementId.h"
16#include "mc/world/level/levelgen/v2/LiquidSettings.h"
17
18// auto generated forward declare list
19// clang-format off
20class BlockPos;
21class BlockSource;
22class BoundingBox;
23class IRandom;
28class Random;
35namespace SharedTypes::v1_21_80 { struct JigsawStructureMetadata; }
36namespace br::worldgen { struct StructureProcessor; }
37// clang-format on
38
39class StructurePoolElement {
40public:
41 // StructurePoolElement inner types declare
42 // clang-format off
43 class ITemplate;
44 class LazyTemplate;
45 // clang-format on
46
47 // StructurePoolElement inner types define
48 class ITemplate {
49 public:
50 // virtual functions
51 // NOLINTBEGIN
52 virtual ~ITemplate() = default;
53
54 virtual ::std::vector<::JigsawBlockInfo> const& getJigsawMarkers() const = 0;
55
56 virtual ::BlockPos getSize(::Rotation rotation) const = 0;
57
58 virtual bool isLegacyStructure() const = 0;
59 // NOLINTEND
60 };
61
63 public:
64 // member variables
65 // NOLINTBEGIN
66 ::ll::TypedStorage<
67 8,
68 16,
69 ::std::variant<
70 ::std::reference_wrapper<::StructureTemplate>,
71 ::std::reference_wrapper<::LegacyStructureTemplate>>>
72 mStructureVariant;
73 ::ll::TypedStorage<8, 24, ::std::vector<::JigsawBlockInfo>> mJigsawMarkers;
74 // NOLINTEND
75
76 public:
77 // virtual functions
78 // NOLINTBEGIN
79 virtual ::std::vector<::JigsawBlockInfo> const& getJigsawMarkers() const /*override*/;
80
81 virtual ::BlockPos getSize(::Rotation rotation) const /*override*/;
82
83 virtual bool isLegacyStructure() const /*override*/;
84 // NOLINTEND
85
86 public:
87 // static functions
88 // NOLINTBEGIN
89 MCAPI static ::std::vector<::JigsawBlockInfo> _findJigsawBlocks(
90 ::std::vector<::JigsawStructureBlockInfo>& jigsawMarkers,
91 ::std::vector<::std::unique_ptr<::StructurePoolBlockTagRule>> const* blockTagRules
92 );
93 // NOLINTEND
94
95 public:
96 // virtual function thunks
97 // NOLINTBEGIN
98 MCFOLD ::std::vector<::JigsawBlockInfo> const& $getJigsawMarkers() const;
99
100 MCAPI ::BlockPos $getSize(::Rotation rotation) const;
101
102 MCAPI bool $isLegacyStructure() const;
103
104
105 // NOLINTEND
106
107 public:
108 // vftables
109 // NOLINTBEGIN
110 MCNAPI static void** $vftable();
111 // NOLINTEND
112 };
113
114 using StructureProcessorList =
115 ::std::vector<::gsl::not_null<::std::shared_ptr<::br::worldgen::StructureProcessor const>>>;
116
117 using StructureProcessorPtr = ::gsl::not_null<::std::shared_ptr<::br::worldgen::StructureProcessor const>>;
118
119public:
120 // member variables
121 // NOLINTBEGIN
122 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::SharedTypes::v1_21_80::JigsawStructureMetadata>> mMetadata;
123 ::ll::TypedStorage<8, 80, ::std::mutex> mMetadataMutex;
124 ::ll::TypedStorage<4, 4, ::brstd::once_flag> mTemplateOnceFlag;
125 ::ll::TypedStorage<8, 56, ::std::optional<::StructurePoolElement::LazyTemplate>> mTemplate;
126 ::ll::TypedStorage<8, 8, uint64> mMetadataKey;
127 ::ll::TypedStorage<8, 32, ::std::string> mLocation;
128 ::ll::TypedStorage<8, 32, ::JigsawStructureUtils::StructureElementId> mId;
129 ::ll::TypedStorage<8, 24, ::Bedrock::NotNullNonOwnerPtr<::IStructureTemplateManager>> mManager;
130 ::ll::TypedStorage<8, 32, ::StructurePoolElementSettings> mSettings;
131 ::ll::TypedStorage<
132 8,
133 16,
134 ::gsl::not_null<::std::shared_ptr<
135 ::std::vector<::gsl::not_null<::std::shared_ptr<::br::worldgen::StructureProcessor const>>> const>>>
136 mProcessors;
137 ::ll::TypedStorage<1, 1, bool> mValid;
138 // NOLINTEND
139
140public:
141 // prevent constructor by default
142 StructurePoolElement();
143
144public:
145 // virtual functions
146 // NOLINTBEGIN
147 virtual ::BlockPos getSize(::Rotation rotation) const;
148
149 virtual ::std::vector<::JigsawBlockInfo> getJigsawMarkers(::BlockPos position, ::Rotation rotation) const;
150
151 virtual ::std::vector<::JigsawBlockInfo>
152 getJigsawMarkers(::BlockPos position, ::LegacyStructureSettings& settings, ::BlockSource* region) const;
153
154 virtual ::BoundingBox getBoundingBox(::BlockPos position, ::Rotation rotation) const;
155
156 virtual void setProjection(::Projection projection);
157
158 virtual ::Projection getProjection() const;
159
160 virtual ::PostProcessSettings getPostProcessSettings() const;
161
162 virtual bool place(
163 ::BlockSource& region,
164 ::BlockPos position,
165 ::Rotation rotation,
166 ::BoundingBox chunkBB,
167 ::Random& random,
168 ::std::unordered_map<::BlockPos, ::std::optional<::ActorDefinitionIdentifier>>& entitiesToPlace,
169 ::BlockPos refPos
170 ) const;
171
172 virtual bool place(
173 ::BlockSource& region,
174 ::BlockPos position,
175 ::BlockPos sectionOrigin,
176 ::BoundingBox chunkBB,
177 ::Rotation rotation,
178 ::IRandom& random,
179 ::br::worldgen::JigsawReplacement jigsaw,
180 ::br::worldgen::LiquidSettings liquidSettings
181 ) const;
182
183 virtual void placeActors(::BlockSource& region, ::BlockPos position, ::Rotation rotation, ::Random& random) const;
184
185 virtual void
186 placeEntities(::BlockSource& region, ::BlockPos position, ::Rotation rotation, ::BoundingBox overlapBB) const;
187
188 virtual void
189 handleJigsawBlock(::BlockSource& region, ::JigsawBlockInfo& jigsawBlock, ::LegacyStructureSettings& settings) const;
190
191 virtual void handleDataMarker(
192 ::BlockSource& region,
193 ::BlockPos markerPos,
194 ::std::string markerData,
195 ::std::unordered_map<::BlockPos, ::std::optional<::ActorDefinitionIdentifier>>& entitiesToPlace
196 ) const;
197
198 virtual bool isValid() const;
199
200 virtual ~StructurePoolElement();
201
202 virtual ::StructurePoolElementType type() const;
203
204 virtual ::std::shared_ptr<::SharedTypes::v1_21_80::JigsawStructureMetadata> createMetadata() const;
205 // NOLINTEND
206
207public:
208 // member functions
209 // NOLINTBEGIN
210 MCAPI StructurePoolElement(
211 ::Bedrock::NotNullNonOwnerPtr<::IStructureTemplateManager> manager,
212 ::std::string const& location,
214 );
215
216 MCAPI StructurePoolElement(
217 ::Bedrock::NotNullNonOwnerPtr<::IStructureTemplateManager> manager,
218 ::std::string const& location,
219 ::gsl::not_null<::std::shared_ptr<
220 ::std::vector<::gsl::not_null<::std::shared_ptr<::br::worldgen::StructureProcessor const>>> const>>
221 processors,
222 ::Projection projection
223 );
224
225 MCAPI StructurePoolElement(
226 ::Bedrock::NotNullNonOwnerPtr<::IStructureTemplateManager> manager,
227 ::std::string const& location,
228 ::Projection projection,
229 ::PostProcessSettings postProcessSettings
230 );
231
232 MCAPI StructurePoolElement(
233 ::Bedrock::NotNullNonOwnerPtr<::IStructureTemplateManager> manager,
234 ::std::string const& location,
235 ::std::vector<::std::unique_ptr<::StructurePoolBlockRule>> const* blockRules,
236 ::std::vector<::std::unique_ptr<::StructurePoolBlockTagRule>> const* blockTagRules,
237 ::std::vector<::std::unique_ptr<::StructurePoolActorRule>> const* actorRules,
238 ::Projection projection,
239 ::PostProcessSettings postProcessSettings
240 );
241
242 MCAPI ::SharedTypes::v1_21_80::JigsawStructureMetadata const& _getMetadata() const;
243
244 MCAPI uint64 _getMetadataKey() const;
245
246#ifdef LL_PLAT_S
248#endif
249 // NOLINTEND
250
251public:
252 // static functions
253 // NOLINTBEGIN
254 MCAPI static ::std::function<::StructurePoolElement const&(::StructureTemplateRegistrationContext, ::Projection)>
255 single(::std::string_view location, ::std::string id);
256
257 MCAPI static ::std::function<::StructurePoolElement const&(::StructureTemplateRegistrationContext, ::Projection)>
258 single(
259 ::std::string_view location,
260 ::gsl::not_null<::std::shared_ptr<
261 ::std::vector<::gsl::not_null<::std::shared_ptr<::br::worldgen::StructureProcessor const>>> const>>
262 processors
263 );
264 // NOLINTEND
265
266public:
267 // constructor thunks
268 // NOLINTBEGIN
269 MCAPI void* $ctor(
270 ::Bedrock::NotNullNonOwnerPtr<::IStructureTemplateManager> manager,
271 ::std::string const& location,
273 );
274
275 MCAPI void* $ctor(
276 ::Bedrock::NotNullNonOwnerPtr<::IStructureTemplateManager> manager,
277 ::std::string const& location,
278 ::gsl::not_null<::std::shared_ptr<
279 ::std::vector<::gsl::not_null<::std::shared_ptr<::br::worldgen::StructureProcessor const>>> const>>
280 processors,
281 ::Projection projection
282 );
283
284 MCAPI void* $ctor(
285 ::Bedrock::NotNullNonOwnerPtr<::IStructureTemplateManager> manager,
286 ::std::string const& location,
287 ::Projection projection,
288 ::PostProcessSettings postProcessSettings
289 );
290
291 MCAPI void* $ctor(
292 ::Bedrock::NotNullNonOwnerPtr<::IStructureTemplateManager> manager,
293 ::std::string const& location,
294 ::std::vector<::std::unique_ptr<::StructurePoolBlockRule>> const* blockRules,
295 ::std::vector<::std::unique_ptr<::StructurePoolBlockTagRule>> const* blockTagRules,
296 ::std::vector<::std::unique_ptr<::StructurePoolActorRule>> const* actorRules,
297 ::Projection projection,
298 ::PostProcessSettings postProcessSettings
299 );
300 // NOLINTEND
301
302public:
303 // destructor thunk
304 // NOLINTBEGIN
305 MCAPI void $dtor();
306 // NOLINTEND
307
308public:
309 // virtual function thunks
310 // NOLINTBEGIN
311 MCAPI ::BlockPos $getSize(::Rotation rotation) const;
312
313 MCAPI ::std::vector<::JigsawBlockInfo> $getJigsawMarkers(::BlockPos position, ::Rotation rotation) const;
314
315 MCAPI ::std::vector<::JigsawBlockInfo>
316 $getJigsawMarkers(::BlockPos position, ::LegacyStructureSettings& settings, ::BlockSource* region) const;
317
318 MCAPI ::BoundingBox $getBoundingBox(::BlockPos position, ::Rotation rotation) const;
319
320 MCAPI void $setProjection(::Projection projection);
321
322#ifdef LL_PLAT_S
323 MCAPI ::Projection $getProjection() const;
324#else // LL_PLAT_C
325 MCFOLD ::Projection $getProjection() const;
326#endif
327
328 MCAPI ::PostProcessSettings $getPostProcessSettings() const;
329
330 MCAPI bool $place(
331 ::BlockSource& region,
332 ::BlockPos position,
333 ::Rotation rotation,
334 ::BoundingBox chunkBB,
335 ::Random& random,
336 ::std::unordered_map<::BlockPos, ::std::optional<::ActorDefinitionIdentifier>>& entitiesToPlace,
337 ::BlockPos refPos
338 ) const;
339
340 MCAPI bool $place(
341 ::BlockSource& region,
342 ::BlockPos position,
343 ::BlockPos sectionOrigin,
344 ::BoundingBox chunkBB,
345 ::Rotation rotation,
346 ::IRandom& random,
347 ::br::worldgen::JigsawReplacement jigsaw,
348 ::br::worldgen::LiquidSettings liquidSettings
349 ) const;
350
351 MCAPI void $placeActors(::BlockSource& region, ::BlockPos position, ::Rotation rotation, ::Random& random) const;
352
353 MCAPI void
354 $placeEntities(::BlockSource& region, ::BlockPos position, ::Rotation rotation, ::BoundingBox overlapBB) const;
355
356 MCAPI void $handleJigsawBlock(
357 ::BlockSource& region,
358 ::JigsawBlockInfo& jigsawBlock,
360 ) const;
361
362 MCAPI void $handleDataMarker(
363 ::BlockSource& region,
364 ::BlockPos markerPos,
365 ::std::string markerData,
366 ::std::unordered_map<::BlockPos, ::std::optional<::ActorDefinitionIdentifier>>& entitiesToPlace
367 ) const;
368
369 MCAPI bool $isValid() const;
370
371 MCFOLD ::StructurePoolElementType $type() const;
372
373 MCAPI ::std::shared_ptr<::SharedTypes::v1_21_80::JigsawStructureMetadata> $createMetadata() const;
374
375
376 // NOLINTEND
377
378public:
379 // vftables
380 // NOLINTBEGIN
381 MCNAPI static void** $vftable();
382 // NOLINTEND
383};
Definition BlockPos.h:17
Definition BlockSource.h:71
Definition BoundingBox.h:13
Definition IRandom.h:10
Definition IStructureTemplateManager.h:16
Definition JigsawBlockInfo.h:14
Definition JigsawStructureBlockInfo.h:14
Definition StructureElementId.h:7
Definition LegacyStructureSettings.h:21
Definition LegacyStructureTemplate.h:27
Definition Random.h:10
Definition StructurePoolActorRule.h:10
Definition StructurePoolBlockRule.h:11
Definition StructurePoolBlockTagRule.h:10
Definition StructurePoolElement.h:48
Definition StructurePoolElement.h:62
static MCAPI void ** $vftable()
static MCAPI void ** $vftable()
Definition StructureTemplate.h:34
Definition ActorDefinitionIdentifier.h:15
Definition JigsawStructureMetadata.h:15
Definition StructurePoolElementSettings.h:16
Definition StructureTemplateRegistrationContext.h:17
Definition StructureProcessor.h:23