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 BlockVolume;
23class BoundingBox;
25class ChunkPos;
26class ChunkViewSource;
27class LevelChunk;
31// clang-format on
32
33class OverworldGenerator : public ::WorldGenerator {
34public:
35 // OverworldGenerator inner types declare
36 // clang-format off
37 struct ThreadData;
38 // clang-format on
39
40 // OverworldGenerator inner types define
41 struct ThreadData {
42 public:
43 // member variables
44 // NOLINTBEGIN
45 ::ll::TypedStorage<4, 4096, ::std::array<float, 1024>> buffer;
46 ::ll::TypedStorage<4, 1024, ::std::array<float, 256>> depthBuffer;
47 ::ll::TypedStorage<4, 1024, ::std::array<float, 256>> dataBuffer;
48 ::ll::TypedStorage<8, 655360, ::std::array<::Block const*, 81920>> blockBuffer;
49 ::ll::TypedStorage<8, 8, float*> fi;
50 ::ll::TypedStorage<8, 8, float*> fis;
51 ::ll::TypedStorage<8, 2560, ::Random> random;
52 // NOLINTEND
53 };
54
56
57public:
58 // member variables
59 // NOLINTBEGIN
60 ::ll::TypedStorage<4, 36, float[9]> mBiomeBlendKernel;
61 ::ll::TypedStorage<1, 1, bool const> mIsLegacyWorld;
62 ::ll::TypedStorage<
63 8,
64 168,
65 ::Bedrock::Threading::
66 InstancedThreadLocal<::OverworldGenerator::ThreadData, ::std::allocator<::OverworldGenerator::ThreadData>>>
67 generatorHelpersPool;
68 ::ll::TypedStorage<8, 32, ::MonsterRoomFeature> monsterRoomFeature;
69 ::ll::TypedStorage<8, 16, ::CanyonFeature> canyonFeature;
70 ::ll::TypedStorage<8, 16, ::UnderwaterCanyonFeature> underwaterCanyonFeature;
71 // NOLINTEND
72
73public:
74 // virtual functions
75 // NOLINTBEGIN
76 virtual ~OverworldGenerator() /*override*/ = default;
77
78 virtual void loadChunk(::LevelChunk& lc, bool forceImmediateReplacementDataLoad) /*override*/;
79
80 virtual bool structurePostProcessChunk(::ChunkViewSource& neighborhoodIn) /*override*/;
81
82 virtual bool decorationPostProcessChunk(::ChunkViewSource& neighborhoodIn) /*override*/;
83
84 virtual ::Util::MultidimensionalArray<float, 5, 5, 41>
85 generateDensityCellsForChunk(::ChunkPos const& chunkPos) const = 0;
86
87 virtual ::WorldGenerator::BlockVolumeDimensions getBlockVolumeDimensions() const /*override*/;
88
89 virtual void prepareHeights(
90 ::BlockVolume& box,
91 ::ChunkPos const& chunkPos,
92 ::std::vector<short>* ZXheights,
93 bool factorInBeardsAndShavers
94 ) /*override*/;
95
96 virtual ::BiomeArea getBiomeArea(::BoundingBox const& area, uint scale) const /*override*/;
97
98 virtual int getLevelGenHeight() const = 0;
99
100 virtual ::std::optional<::XoroshiroPositionalRandomFactory> getXoroshiroPositionalRandomFactory() const = 0;
101
102 virtual ::std::unique_ptr<::Aquifer> tryMakeAquifer(
103 ::ChunkPos const& chunkPos,
104 ::SurfaceLevelCache const& surfaceLevelCache,
105 short minHeight,
106 short levelGenHeight,
107 short seaLevel
108 ) const;
109
110 virtual void decorateWorldGenLoadChunk(
111 ::Biome const& biome,
112 ::LevelChunk& lc,
113 ::BlockVolumeTarget& target,
114 ::Random& random,
115 ::ChunkPos const& pos
116 ) const /*override*/;
117
118 virtual ::ChunkLocalNoiseCache createNoiseCache(::ChunkPos chunkPos) const;
119
120 virtual ::PerlinSimplexNoise const& getSurfaceNoise() = 0;
121
122 virtual ::std::unique_ptr<::PerlinSimplexNoise> const& getMaterialAdjNoise() const = 0;
123
124 virtual void _prepareHeights(
125 ::BlockVolume& box,
126 ::ChunkPos const& chunkPos,
127 ::ChunkLocalNoiseCache const& chunkLocalNoiseCache,
128 ::Aquifer* aquiferPtr,
129 ::std::function<void(::BlockPos const&, ::Block const&, int)>&& tickUpdateFn,
130 bool factorInBeardsAndShavers,
131 ::std::vector<short>* ZXheights
132 ) = 0;
133 // NOLINTEND
134
135public:
136 // virtual function thunks
137 // NOLINTBEGIN
138 MCAPI void $loadChunk(::LevelChunk& lc, bool forceImmediateReplacementDataLoad);
139
140 MCAPI bool $structurePostProcessChunk(::ChunkViewSource& neighborhoodIn);
141
142 MCAPI bool $decorationPostProcessChunk(::ChunkViewSource& neighborhoodIn);
143
144 MCAPI ::WorldGenerator::BlockVolumeDimensions $getBlockVolumeDimensions() const;
145
146 MCAPI void $prepareHeights(
147 ::BlockVolume& box,
148 ::ChunkPos const& chunkPos,
149 ::std::vector<short>* ZXheights,
150 bool factorInBeardsAndShavers
151 );
152
153 MCAPI ::BiomeArea $getBiomeArea(::BoundingBox const& area, uint scale) const;
154
155 MCFOLD ::std::unique_ptr<::Aquifer> $tryMakeAquifer(
156 ::ChunkPos const& chunkPos,
157 ::SurfaceLevelCache const& surfaceLevelCache,
158 short minHeight,
159 short levelGenHeight,
160 short seaLevel
161 ) const;
162
163 MCAPI void $decorateWorldGenLoadChunk(
164 ::Biome const& biome,
165 ::LevelChunk& lc,
166 ::BlockVolumeTarget& target,
167 ::Random& random,
168 ::ChunkPos const& pos
169 ) const;
170
171 MCAPI ::ChunkLocalNoiseCache $createNoiseCache(::ChunkPos chunkPos) const;
172
173
174 // NOLINTEND
175};
Definition Aquifer.h:17
Definition BiomeArea.h:10
Definition Biome.h:23
Definition BlockPos.h:17
Definition BlockVolumeTarget.h:28
Definition BlockVolume.h:14
Definition Block.h:41
Definition BoundingBox.h:13
Definition ChunkLocalNoiseCache.h:8
Definition ChunkPos.h:13
Definition ChunkViewSource.h:22
Definition LevelChunk.h:77
Definition OverworldGenerator.h:33
Definition PerlinSimplexNoise.h:11
Definition Random.h:10
Definition SurfaceLevelCache.h:9
Definition MultidimensionalArray.h:12
Definition XoroshiroPositionalRandomFactory.h:15
STL namespace.
Definition OverworldGenerator.h:41
Definition WorldGenerator.h:43