LeviLamina
Loading...
Searching...
No Matches
WorldGenerator.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/utility/buffer_span.h"
7#include "mc/platform/threading/Mutex.h"
8#include "mc/world/level/ChunkPos.h"
9#include "mc/world/level/DividedPos2d.h"
10#include "mc/world/level/chunk/ChunkSource.h"
11#include "mc/world/level/levelgen/v1/IPreliminarySurfaceProvider.h"
12
13// auto generated forward declare list
14// clang-format off
15class Biome;
16class BiomeArea;
17class BiomeSource;
18class BlockPos;
19class BlockSource;
20class BlockVolume;
22class BoundingBox;
23class Dimension;
24class HashedString;
25class LevelChunk;
26class Random;
28// clang-format on
29
31public:
32 // WorldGenerator inner types declare
33 // clang-format off
35 // clang-format on
36
37 // WorldGenerator inner types define
39 public:
40 // member variables
41 // NOLINTBEGIN
42 ::ll::TypedStorage<4, 4, uint> mWidth;
43 ::ll::TypedStorage<4, 4, uint> mDepth;
44 ::ll::TypedStorage<4, 4, uint> mHeight;
45 // NOLINTEND
46 };
47
48public:
49 // member variables
50 // NOLINTBEGIN
51 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::StructureFeatureRegistry>> mStructureFeatureRegistry;
52 ::ll::TypedStorage<8, 80, ::Bedrock::Threading::Mutex> mCreateStructuresAndVisitedPositionsMutex;
53 ::ll::TypedStorage<8, 72, ::std::condition_variable> mStructureInstanceWaitVar;
54 ::ll::TypedStorage<4, 4, ::std::atomic<int>> mActiveStructureInstanceCreateCount;
55 ::ll::TypedStorage<8, 64, ::std::unordered_set<::ChunkPos>> mVisitedPositions;
56 // NOLINTEND
57
58public:
59 // prevent constructor by default
61
62public:
63 // virtual functions
64 // NOLINTBEGIN
65 // vIndex: 0
66 virtual ~WorldGenerator() /*override*/;
67
68 // vIndex: 34
69 virtual ::HashedString findStructureFeatureTypeAt(::BlockPos const& pos);
70
71 // vIndex: 35
72 virtual bool isStructureFeatureTypeAt(::BlockPos const& pos, ::HashedString type) const;
73
74 // vIndex: 36
75 virtual bool findNearestStructureFeature(
76 ::HashedString feature,
77 ::BlockPos const& origin,
78 ::BlockPos& pos,
79 bool mustBeInNewChunks,
80 ::std::optional<::HashedString> biomeTag
81 );
82
83 // vIndex: 37
84 virtual void garbageCollectBlueprints(::buffer_span<::ChunkPos> activeChunks);
85
86 // vIndex: 38
87 virtual void prepareHeights(::BlockVolume&, ::ChunkPos const&, bool) = 0;
88
89 // vIndex: 39
90 virtual void prepareAndComputeHeights(::BlockVolume&, ::ChunkPos const&, ::std::vector<short>&, bool, int) = 0;
91
92 // vIndex: 40
93 virtual ::BiomeArea getBiomeArea(::BoundingBox const&, uint) const = 0;
94
95 // vIndex: 41
96 virtual ::BiomeSource const& getBiomeSource() const = 0;
97
98 // vIndex: 42
99 virtual ::WorldGenerator::BlockVolumeDimensions getBlockVolumeDimensions() const = 0;
100
101 // vIndex: 43
102 virtual ::BlockPos findSpawnPosition() const = 0;
103
104 // vIndex: 44
105 virtual void addHardcodedSpawnAreas(::LevelChunk& lc);
106
107 // vIndex: 13
108 virtual void
109 postProcessMobsAt(::BlockSource& region, int chunkWestBlock, int chunkNorthBlock, ::Random& random) /*override*/;
110
111 // vIndex: 12
112 virtual void postProcessMobsAt(::BlockSource& region, ::BoundingBox const& chunkBB) const /*override*/;
113
114 // vIndex: 1
115 virtual ::std::optional<short> getPreliminarySurfaceLevel(::DividedPos2d<4>) const /*override*/;
116
117 // vIndex: 45
118 virtual void debugRender();
119
120 // vIndex: 46
121 virtual void decorateWorldGenLoadChunk(
122 ::Biome const&,
125 ::Random&,
126 ::ChunkPos const&
127 ) const = 0;
128
129 // vIndex: 47
130 virtual void decorateWorldGenPostProcess(::Biome const&, ::LevelChunk&, ::BlockSource&, ::Random&) const = 0;
131 // NOLINTEND
132
133public:
134 // member functions
135 // NOLINTBEGIN
136 MCAPI
137 WorldGenerator(::Dimension& dimension, ::std::unique_ptr<::StructureFeatureRegistry> structureFeatureRegistry);
138
139 MCAPI ::std::vector<short> computeChunkHeightMap(::ChunkPos const& pos);
140
141 MCAPI void postProcessStructureFeatures(::BlockSource& region, ::Random& random, int chunkX, int chunkZ);
142
143 MCAPI void postProcessStructures(::BlockSource& region, ::Random& random, int chunkX, int chunkZ);
144
145 MCAPI void preProcessStructures(::Dimension& dimension, ::ChunkPos const& cp, ::BiomeSource const& biomeSource);
146
147 MCAPI void prepareStructureFeatureBlueprints(
148 ::Dimension& dimension,
149 ::ChunkPos const& cp,
150 ::BiomeSource const& biomeSource,
151 ::IPreliminarySurfaceProvider const& preliminarySurfaceProvider
152 );
153
154 MCAPI void waitForStructures();
155 // NOLINTEND
156
157public:
158 // static variables
159 // NOLINTBEGIN
160 MCAPI static uint64 const& TICKING_QUEUE_PASS_LIMIT();
161 // NOLINTEND
162
163public:
164 // constructor thunks
165 // NOLINTBEGIN
166 MCAPI void* $ctor(::Dimension& dimension, ::std::unique_ptr<::StructureFeatureRegistry> structureFeatureRegistry);
167 // NOLINTEND
168
169public:
170 // destructor thunk
171 // NOLINTBEGIN
172 MCAPI void $dtor();
173 // NOLINTEND
174
175public:
176 // virtual function thunks
177 // NOLINTBEGIN
178 MCAPI ::HashedString $findStructureFeatureTypeAt(::BlockPos const& pos);
179
180 MCAPI bool $isStructureFeatureTypeAt(::BlockPos const& pos, ::HashedString type) const;
181
182 MCAPI bool $findNearestStructureFeature(
183 ::HashedString feature,
184 ::BlockPos const& origin,
185 ::BlockPos& pos,
186 bool mustBeInNewChunks,
187 ::std::optional<::HashedString> biomeTag
188 );
189
190 MCAPI void $garbageCollectBlueprints(::buffer_span<::ChunkPos> activeChunks);
191
192 MCAPI void $addHardcodedSpawnAreas(::LevelChunk& lc);
193
194 MCAPI void $postProcessMobsAt(::BlockSource& region, int chunkWestBlock, int chunkNorthBlock, ::Random& random);
195
196 MCAPI void $postProcessMobsAt(::BlockSource& region, ::BoundingBox const& chunkBB) const;
197
198 MCAPI ::std::optional<short> $getPreliminarySurfaceLevel(::DividedPos2d<4>) const;
199
200 MCFOLD void $debugRender();
201 // NOLINTEND
202
203public:
204 // vftables
205 // NOLINTBEGIN
207
208 MCNAPI static void** $vftableForChunkSource();
209 // NOLINTEND
210};
Definition BiomeArea.h:11
Definition BiomeSource.h:19
Definition Biome.h:26
Definition BlockPos.h:18
Definition BlockSource.h:67
Definition BlockVolumeTarget.h:24
Definition BlockVolume.h:13
Definition BoundingBox.h:13
Definition ChunkPos.h:11
Definition ChunkSource.h:34
Definition Dimension.h:83
Definition DividedPos2d.h:7
Definition HashedString.h:5
Definition IPreliminarySurfaceProvider.h:8
Definition LevelChunk.h:74
Definition Random.h:11
Definition StructureFeatureRegistry.h:19
Definition WorldGenerator.h:30
static MCAPI void ** $vftableForChunkSource()
static MCAPI void ** $vftableForIPreliminarySurfaceProvider()
Definition buffer_span.h:6
Definition WorldGenerator.h:38