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 propagateCombinedChunkSource(::ChunkSource*);
122
123 // vIndex: 47
124 virtual void decorateWorldGenLoadChunk(
125 ::Biome const&,
128 ::Random&,
129 ::ChunkPos const&
130 ) const = 0;
131
132 // vIndex: 48
133 virtual void decorateWorldGenPostProcess(::Biome const&, ::LevelChunk&, ::BlockSource&, ::Random&) const = 0;
134 // NOLINTEND
135
136public:
137 // member functions
138 // NOLINTBEGIN
139 MCAPI
140 WorldGenerator(::Dimension& dimension, ::std::unique_ptr<::StructureFeatureRegistry> structureFeatureRegistry);
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& 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 void $garbageCollectBlueprints(::buffer_span<::ChunkPos> activeChunks);
194
195 MCAPI void $addHardcodedSpawnAreas(::LevelChunk& lc);
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: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