Skip to content
LeviMC
English
AutoLightDark
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 MCNAPI 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 MCNAPI ::std::vector<::JigsawBlockInfo> const& $getJigsawMarkers() const;
99
100 MCNAPI ::BlockPos $getSize(::Rotation rotation) const;
101
102 MCNAPI 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
211 ::Bedrock::NotNullNonOwnerPtr<::IStructureTemplateManager> manager,
212 ::std::string const& location,
214 );
215
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
226 ::Bedrock::NotNullNonOwnerPtr<::IStructureTemplateManager> manager,
227 ::std::string const& location,
228 ::Projection projection,
229 ::PostProcessSettings postProcessSettings
230 );
231
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 MCNAPI ::SharedTypes::v1_21_80::JigsawStructureMetadata const& _getMetadata() const;
243
244 MCNAPI uint64 _getMetadataKey() const;
245
246#ifdef LL_PLAT_C
247 MCNAPI void setId(::JigsawStructureUtils::StructureElementId id);
248#endif
249 // NOLINTEND
250
251public:
252 // static functions
253 // NOLINTBEGIN
254 MCNAPI static ::std::function<::StructurePoolElement const&(::StructureTemplateRegistrationContext, ::Projection)>
255 single(::std::string_view location, ::std::string id);
256
257 MCNAPI static ::std::function<::StructurePoolElement const&(::StructureTemplateRegistrationContext, ::Projection)>
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 MCNAPI void* $ctor(
270 ::Bedrock::NotNullNonOwnerPtr<::IStructureTemplateManager> manager,
271 ::std::string const& location,
273 );
274
275 MCNAPI 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 MCNAPI void* $ctor(
285 ::Bedrock::NotNullNonOwnerPtr<::IStructureTemplateManager> manager,
286 ::std::string const& location,
287 ::Projection projection,
288 ::PostProcessSettings postProcessSettings
289 );
290
291 MCNAPI 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 MCNAPI void $dtor();
306 // NOLINTEND
307
308public:
309 // virtual function thunks
310 // NOLINTBEGIN
311 MCNAPI ::BlockPos $getSize(::Rotation rotation) const;
312
313 MCNAPI ::std::vector<::JigsawBlockInfo> $getJigsawMarkers(::BlockPos position, ::Rotation rotation) const;
314
315 MCNAPI ::std::vector<::JigsawBlockInfo>
317
318 MCNAPI ::BoundingBox $getBoundingBox(::BlockPos position, ::Rotation rotation) const;
319
320 MCNAPI void $setProjection(::Projection projection);
321
322 MCNAPI ::Projection $getProjection() const;
323
324 MCNAPI ::PostProcessSettings $getPostProcessSettings() const;
325
326 MCNAPI bool $place(
327 ::BlockSource& region,
328 ::BlockPos position,
329 ::Rotation rotation,
330 ::BoundingBox chunkBB,
331 ::Random& random,
332 ::std::unordered_map<::BlockPos, ::std::optional<::ActorDefinitionIdentifier>>& entitiesToPlace,
333 ::BlockPos refPos
334 ) const;
335
336 MCNAPI bool $place(
337 ::BlockSource& region,
338 ::BlockPos position,
339 ::BlockPos sectionOrigin,
340 ::BoundingBox chunkBB,
341 ::Rotation rotation,
342 ::IRandom& random,
343 ::br::worldgen::JigsawReplacement jigsaw,
344 ::br::worldgen::LiquidSettings liquidSettings
345 ) const;
346
347 MCNAPI void $placeActors(::BlockSource& region, ::BlockPos position, ::Rotation rotation, ::Random& random) const;
348
349 MCNAPI void
350 $placeEntities(::BlockSource& region, ::BlockPos position, ::Rotation rotation, ::BoundingBox overlapBB) const;
351
353 ::BlockSource& region,
354 ::JigsawBlockInfo& jigsawBlock,
356 ) const;
357
358 MCNAPI void $handleDataMarker(
359 ::BlockSource& region,
360 ::BlockPos markerPos,
361 ::std::string markerData,
362 ::std::unordered_map<::BlockPos, ::std::optional<::ActorDefinitionIdentifier>>& entitiesToPlace
363 ) const;
364
365 MCNAPI bool $isValid() const;
366
367 MCNAPI ::StructurePoolElementType $type() const;
368
369 MCNAPI ::std::shared_ptr<::SharedTypes::v1_21_80::JigsawStructureMetadata> $createMetadata() const;
370
371
372 // NOLINTEND
373
374public:
375 // vftables
376 // NOLINTBEGIN
377 MCNAPI static void** $vftable();
378 // NOLINTEND
379};
Definition BlockPos.h:14
Definition BlockSource.h:72
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:12
Definition StructurePoolBlockTagRule.h:13
Definition StructurePoolElement.h:48
Definition StructurePoolElement.h:62
MCAPI ::std::vector<::JigsawBlockInfo > const & $getJigsawMarkers() const
MCAPI bool $isLegacyStructure() const
static MCAPI ::std::vector<::JigsawBlockInfo > _findJigsawBlocks(::std::vector<::JigsawStructureBlockInfo > &jigsawMarkers, ::std::vector<::std::unique_ptr<::StructurePoolBlockTagRule > > const *blockTagRules)
static MCAPI void ** $vftable()
MCAPI::BlockPos $getSize(::Rotation rotation) const
MCAPI void * $ctor(::Bedrock::NotNullNonOwnerPtr<::IStructureTemplateManager > manager, ::std::string const &location, ::gsl::not_null<::std::shared_ptr< ::std::vector<::gsl::not_null<::std::shared_ptr<::br::worldgen::StructureProcessor const > > > const > > processors, ::Projection projection)
MCAPI::BlockPos $getSize(::Rotation rotation) const
MCAPI void $setProjection(::Projection projection)
MCAPI bool $isValid() const
MCAPI void $dtor()
MCAPI::SharedTypes::v1_21_80::JigsawStructureMetadata const & _getMetadata() const
MCAPI void * $ctor(::Bedrock::NotNullNonOwnerPtr<::IStructureTemplateManager > manager, ::std::string const &location, ::Projection projection, ::PostProcessSettings postProcessSettings)
MCAPI ::std::vector<::JigsawBlockInfo > $getJigsawMarkers(::BlockPos position, ::LegacyStructureSettings &settings, ::BlockSource *region) const
MCAPI void $placeEntities(::BlockSource &region, ::BlockPos position, ::Rotation rotation, ::BoundingBox overlapBB) const
static MCAPI ::std::function<::StructurePoolElement const &(::StructureTemplateRegistrationContext, ::Projection)> single(::std::string_view location, ::std::string id)
MCAPI void $placeActors(::BlockSource &region, ::BlockPos position, ::Rotation rotation, ::Random &random) const
MCAPI::BoundingBox $getBoundingBox(::BlockPos position, ::Rotation rotation) const
MCAPI StructurePoolElement(::Bedrock::NotNullNonOwnerPtr<::IStructureTemplateManager > manager, ::std::string const &location, ::std::vector<::std::unique_ptr<::StructurePoolBlockRule > > const *blockRules, ::std::vector<::std::unique_ptr<::StructurePoolBlockTagRule > > const *blockTagRules, ::std::vector<::std::unique_ptr<::StructurePoolActorRule > > const *actorRules, ::Projection projection, ::PostProcessSettings postProcessSettings)
static MCAPI void ** $vftable()
MCAPI ::std::shared_ptr<::SharedTypes::v1_21_80::JigsawStructureMetadata > $createMetadata() const
MCAPI void $handleDataMarker(::BlockSource &region, ::BlockPos markerPos, ::std::string markerData, ::std::unordered_map<::BlockPos, ::std::optional<::ActorDefinitionIdentifier > > &entitiesToPlace) const
MCAPI void * $ctor(::Bedrock::NotNullNonOwnerPtr<::IStructureTemplateManager > manager, ::std::string const &location, ::StructurePoolElementSettings settings)
MCAPI uint64 _getMetadataKey() const
MCAPI::StructurePoolElementType $type() const
MCAPI void $handleJigsawBlock(::BlockSource &region, ::JigsawBlockInfo &jigsawBlock, ::LegacyStructureSettings &settings) const
MCAPI::PostProcessSettings $getPostProcessSettings() const
MCAPI void * $ctor(::Bedrock::NotNullNonOwnerPtr<::IStructureTemplateManager > manager, ::std::string const &location, ::std::vector<::std::unique_ptr<::StructurePoolBlockRule > > const *blockRules, ::std::vector<::std::unique_ptr<::StructurePoolBlockTagRule > > const *blockTagRules, ::std::vector<::std::unique_ptr<::StructurePoolActorRule > > const *actorRules, ::Projection projection, ::PostProcessSettings postProcessSettings)
static MCAPI ::std::function<::StructurePoolElement const &(::StructureTemplateRegistrationContext, ::Projection)> single(::std::string_view location, ::gsl::not_null<::std::shared_ptr< ::std::vector<::gsl::not_null<::std::shared_ptr<::br::worldgen::StructureProcessor const > > > const > > processors)
MCAPI bool $place(::BlockSource &region, ::BlockPos position, ::BlockPos sectionOrigin, ::BoundingBox chunkBB, ::Rotation rotation, ::IRandom &random, ::br::worldgen::JigsawReplacement jigsaw, ::br::worldgen::LiquidSettings liquidSettings) const
MCAPI StructurePoolElement(::Bedrock::NotNullNonOwnerPtr<::IStructureTemplateManager > manager, ::std::string const &location, ::Projection projection, ::PostProcessSettings postProcessSettings)
MCAPI::Projection $getProjection() const
MCAPI StructurePoolElement(::Bedrock::NotNullNonOwnerPtr<::IStructureTemplateManager > manager, ::std::string const &location, ::StructurePoolElementSettings settings)
MCAPI StructurePoolElement(::Bedrock::NotNullNonOwnerPtr<::IStructureTemplateManager > manager, ::std::string const &location, ::gsl::not_null<::std::shared_ptr< ::std::vector<::gsl::not_null<::std::shared_ptr<::br::worldgen::StructureProcessor const > > > const > > processors, ::Projection projection)
MCAPI bool $place(::BlockSource &region, ::BlockPos position, ::Rotation rotation, ::BoundingBox chunkBB, ::Random &random, ::std::unordered_map<::BlockPos, ::std::optional<::ActorDefinitionIdentifier > > &entitiesToPlace, ::BlockPos refPos) const
MCAPI ::std::vector<::JigsawBlockInfo > $getJigsawMarkers(::BlockPos position, ::Rotation rotation) const
Definition StructureTemplate.h:35
Definition ActorDefinitionIdentifier.h:15
Definition JigsawStructureMetadata.h:15
Definition StructurePoolElementSettings.h:16
Definition StructureTemplateRegistrationContext.h:17
Definition StructureProcessor.h:23