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 // NOLINTEND
155
156public:
157 // static functions
158 // NOLINTBEGIN
159 MCAPI static void
160 _fixWaterAlongEdges(::LevelChunk const& lc, ::BlockSource& source, ::BlockTickingQueue& instaTickQueue);
161 // NOLINTEND
162
163public:
164 // constructor thunks
165 // NOLINTBEGIN
166 MCAPI void* $ctor(::Dimension& dimension, bool isLegacyWorld);
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 void $loadChunk(::LevelChunk& lc, bool forceImmediateReplacementDataLoad);
179
180 MCAPI bool $structurePostProcessChunk(::ChunkViewSource& neighborhoodIn);
181
182 MCAPI bool $decorationPostProcessChunk(::ChunkViewSource& neighborhoodIn);
183
184 MCAPI ::WorldGenerator::BlockVolumeDimensions $getBlockVolumeDimensions() const;
185
186 MCAPI void $prepareHeights(
187 ::BlockVolume& box,
188 ::ChunkPos const& chunkPos,
189 ::std::vector<short>* ZXheights,
190 bool factorInBeardsAndShavers
191 );
192
193 MCAPI ::BiomeArea $getBiomeArea(::BoundingBox const& area, uint scale) const;
194
195 MCFOLD ::std::unique_ptr<::Aquifer> $tryMakeAquifer(
196 ::ChunkPos const& chunkPos,
197 ::SurfaceLevelCache const& surfaceLevelCache,
198 short minHeight,
199 short levelGenHeight,
200 short seaLevel
201 ) const;
202
203 MCFOLD void $decorateWorldGenLoadChunk(
204 ::Biome const& biome,
205 ::LevelChunk& lc,
206 ::BlockVolumeTarget& target,
207 ::Random& random,
208 ::ChunkPos const& pos
209 ) const;
210
211 MCAPI ::ChunkLocalNoiseCache $createNoiseCache(::ChunkPos chunkPos) const;
212
213
214 // NOLINTEND
215
216public:
217 // vftables
218 // NOLINTBEGIN
219 MCNAPI static void** $vftableForChunkSource();
220
222 // NOLINTEND
223};
Definition Aquifer.h:17
Definition BiomeArea.h:11
Definition Biome.h:24
Definition BlockPos.h:21
Definition BlockSource.h:73
Definition BlockTickingQueue.h:27
Definition BlockVolumeTarget.h:28
Definition BlockVolume.h:14
Definition Block.h:69
Definition BoundingBox.h:13
Definition ChunkLocalNoiseCache.h:8
Definition ChunkPos.h:11
Definition ChunkViewSource.h:23
Definition Dimension.h:89
Definition LevelChunk.h:87
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:15
STL namespace.
Definition OverworldGenerator.h:44
Definition WorldGenerator.h:39