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