LeviLamina
Loading...
Searching...
No Matches
OverworldGenerator.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/threading/InstancedThreadLocal.h"
7#include "mc/util/MultidimensionalArray.h"
8#include "mc/util/Random.h"
9#include "mc/world/level/levelgen/WorldGenerator.h"
10#include "mc/world/level/levelgen/feature/CanyonFeature.h"
11#include "mc/world/level/levelgen/feature/MonsterRoomFeature.h"
12#include "mc/world/level/levelgen/feature/UnderwaterCanyonFeature.h"
13
14// auto generated forward declare list
15// clang-format off
16class Aquifer;
17class Biome;
18class BiomeArea;
19class Block;
20class BlockPos;
21class BlockSource;
23class BlockVolume;
25class BoundingBox;
27class ChunkPos;
28class ChunkViewSource;
29class Dimension;
30class LevelChunk;
34// clang-format on
35
36class OverworldGenerator : public ::WorldGenerator {
37public:
38 // OverworldGenerator inner types declare
39 // clang-format off
40 struct ThreadData;
41 // clang-format on
42
43 // OverworldGenerator inner types define
44 struct ThreadData {
45 public:
46 // member variables
47 // NOLINTBEGIN
48 ::ll::TypedStorage<4, 4096, ::std::array<float, 1024>> buffer;
49 ::ll::TypedStorage<4, 1024, ::std::array<float, 256>> depthBuffer;
50 ::ll::TypedStorage<4, 1024, ::std::array<float, 256>> dataBuffer;
51 ::ll::TypedStorage<8, 655360, ::std::array<::Block const*, 81920>> blockBuffer;
52 ::ll::TypedStorage<8, 8, float*> fi;
53 ::ll::TypedStorage<8, 8, float*> fis;
54 ::ll::TypedStorage<8, 2544, ::Random> random;
55 // NOLINTEND
56 };
57
59
60public:
61 // member variables
62 // NOLINTBEGIN
63 ::ll::TypedStorage<4, 36, float[9]> mBiomeBlendKernel;
64 ::ll::TypedStorage<1, 1, bool const> mIsLegacyWorld;
65 ::ll::TypedStorage<
66 8,
67 168,
68 ::Bedrock::Threading::
69 InstancedThreadLocal<::OverworldGenerator::ThreadData, ::std::allocator<::OverworldGenerator::ThreadData>>>
70 generatorHelpersPool;
71 ::ll::TypedStorage<8, 32, ::MonsterRoomFeature> monsterRoomFeature;
72 ::ll::TypedStorage<8, 16, ::CanyonFeature> canyonFeature;
73 ::ll::TypedStorage<8, 16, ::UnderwaterCanyonFeature> underwaterCanyonFeature;
74 // NOLINTEND
75
76public:
77 // prevent constructor by default
78 OverworldGenerator();
79
80public:
81 // virtual functions
82 // NOLINTBEGIN
83 virtual ~OverworldGenerator() /*override*/;
84
85 virtual void loadChunk(::LevelChunk& lc, bool forceImmediateReplacementDataLoad) /*override*/;
86
87 virtual bool structurePostProcessChunk(::ChunkViewSource& neighborhoodIn) /*override*/;
88
89 virtual bool decorationPostProcessChunk(::ChunkViewSource& neighborhoodIn) /*override*/;
90
91 virtual ::Util::MultidimensionalArray<float, 5, 5, 41>
92 generateDensityCellsForChunk(::ChunkPos const& chunkPos) const = 0;
93
94 virtual ::WorldGenerator::BlockVolumeDimensions getBlockVolumeDimensions() const /*override*/;
95
96 virtual void prepareHeights(
97 ::BlockVolume& box,
98 ::ChunkPos const& chunkPos,
99 ::std::vector<short>* ZXheights,
100 bool factorInBeardsAndShavers
101 ) /*override*/;
102
103 virtual ::BiomeArea getBiomeArea(::BoundingBox const& area, uint scale) const /*override*/;
104
105 virtual int getLevelGenHeight() const = 0;
106
107 virtual ::std::optional<::XoroshiroPositionalRandomFactory> getXoroshiroPositionalRandomFactory() const = 0;
108
109 virtual ::std::unique_ptr<::Aquifer> tryMakeAquifer(
110 ::ChunkPos const& chunkPos,
111 ::SurfaceLevelCache const& surfaceLevelCache,
112 short minHeight,
113 short levelGenHeight,
114 short seaLevel
115 ) const;
116
117 virtual void decorateWorldGenLoadChunk(
118 ::Biome const& biome,
119 ::LevelChunk& lc,
120 ::BlockVolumeTarget& target,
121 ::Random& random,
122 ::ChunkPos const& pos
123 ) const /*override*/;
124
125 virtual ::ChunkLocalNoiseCache createNoiseCache(::ChunkPos chunkPos) const;
126
127 virtual ::PerlinSimplexNoise const& getSurfaceNoise() = 0;
128
129 virtual ::std::unique_ptr<::PerlinSimplexNoise> const& getMaterialAdjNoise() const = 0;
130
131 virtual void _prepareHeights(
132 ::BlockVolume& box,
133 ::ChunkPos const& chunkPos,
134 ::ChunkLocalNoiseCache const& chunkLocalNoiseCache,
135 ::Aquifer* aquiferPtr,
136 ::std::function<void(::BlockPos const&, ::Block const&, int)>&& tickUpdateFn,
137 bool factorInBeardsAndShavers,
138 ::std::vector<short>* ZXheights
139 ) = 0;
140 // NOLINTEND
141
142public:
143 // member functions
144 // NOLINTBEGIN
145 MCAPI OverworldGenerator(::Dimension& dimension, bool isLegacyWorld);
146
147 MCAPI void buildSurfaces(
148 ::OverworldGenerator::ThreadData& thread,
149 ::BlockVolume& blocks,
150 ::LevelChunk& levelChunk,
151 ::ChunkPos const& chunkPos,
152 ::SurfaceLevelCache const& surfaceLevelCache
153 );
154
155 MCAPI ::SurfaceLevelCache createSurfaceLevelCache(::ChunkPos chunkPos) const;
156 // NOLINTEND
157
158public:
159 // static functions
160 // NOLINTBEGIN
161 MCAPI static void
162 _fixWaterAlongEdges(::LevelChunk const& lc, ::BlockSource& source, ::BlockTickingQueue& instaTickQueue);
163 // NOLINTEND
164
165public:
166 // constructor thunks
167 // NOLINTBEGIN
168 MCAPI void* $ctor(::Dimension& dimension, bool isLegacyWorld);
169 // NOLINTEND
170
171public:
172 // destructor thunk
173 // NOLINTBEGIN
174 MCAPI void $dtor();
175 // NOLINTEND
176
177public:
178 // virtual function thunks
179 // NOLINTBEGIN
180 MCAPI void $loadChunk(::LevelChunk& lc, bool forceImmediateReplacementDataLoad);
181
182 MCAPI bool $structurePostProcessChunk(::ChunkViewSource& neighborhoodIn);
183
184 MCAPI bool $decorationPostProcessChunk(::ChunkViewSource& neighborhoodIn);
185
186 MCAPI ::WorldGenerator::BlockVolumeDimensions $getBlockVolumeDimensions() const;
187
188 MCAPI void $prepareHeights(
189 ::BlockVolume& box,
190 ::ChunkPos const& chunkPos,
191 ::std::vector<short>* ZXheights,
192 bool factorInBeardsAndShavers
193 );
194
195 MCAPI ::BiomeArea $getBiomeArea(::BoundingBox const& area, uint scale) const;
196
197 MCFOLD ::std::unique_ptr<::Aquifer> $tryMakeAquifer(
198 ::ChunkPos const& chunkPos,
199 ::SurfaceLevelCache const& surfaceLevelCache,
200 short minHeight,
201 short levelGenHeight,
202 short seaLevel
203 ) const;
204
205 MCFOLD void $decorateWorldGenLoadChunk(
206 ::Biome const& biome,
207 ::LevelChunk& lc,
208 ::BlockVolumeTarget& target,
209 ::Random& random,
210 ::ChunkPos const& pos
211 ) const;
212
213 MCAPI ::ChunkLocalNoiseCache $createNoiseCache(::ChunkPos chunkPos) const;
214
215
216 // NOLINTEND
217
218public:
219 // vftables
220 // NOLINTBEGIN
221 MCNAPI static void** $vftableForChunkSource();
222
224 // NOLINTEND
225};
Definition Aquifer.h:17
Definition BiomeArea.h:11
Definition Biome.h:23
Definition BlockPos.h:19
Definition BlockSource.h:71
Definition BlockTickingQueue.h:25
Definition BlockVolumeTarget.h:29
Definition BlockVolume.h:13
Definition Block.h:43
Definition BoundingBox.h:13
Definition ChunkLocalNoiseCache.h:8
Definition ChunkPos.h:11
Definition ChunkViewSource.h:22
Definition Dimension.h:85
Definition LevelChunk.h:79
static MCAPI void ** $vftableForIPreliminarySurfaceProvider()
static MCAPI void ** $vftableForChunkSource()
Definition PerlinSimplexNoise.h:13
Definition Random.h:10
Definition SurfaceLevelCache.h:9
Definition MultidimensionalArray.h:12
Definition XoroshiroPositionalRandomFactory.h:16
STL namespace.
Definition OverworldGenerator.h:44
Definition WorldGenerator.h:39