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/world/level/DividedPos2d.h"
8#include "mc/world/level/chunk/ChunkSource.h"
9#include "mc/world/level/levelgen/v1/IPreliminarySurfaceProvider.h"
10
11// auto generated forward declare list
12// clang-format off
13class Biome;
14class BiomeArea;
15class BiomeSource;
16class BlockPos;
17class BlockSource;
18class BlockVolume;
20class BoundingBox;
21class ChunkPos;
22class Dimension;
23class HashedString;
24class LevelChunk;
25class Random;
27namespace Bedrock::Threading { class Mutex; }
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 // virtual functions
60 // NOLINTBEGIN
61 // vIndex: 0
62 virtual ~WorldGenerator() /*override*/;
63
64 // vIndex: 34
65 virtual ::HashedString findStructureFeatureTypeAt(::BlockPos const& pos);
66
67 // vIndex: 35
68 virtual bool isStructureFeatureTypeAt(::BlockPos const& pos, ::HashedString type) const;
69
70 // vIndex: 36
71 virtual bool findNearestStructureFeature(
72 ::HashedString feature,
73 ::BlockPos const& origin,
74 ::BlockPos& pos,
75 bool mustBeInNewChunks,
76 ::std::optional<::HashedString> biomeTag
77 );
78
79 // vIndex: 37
80 virtual void garbageCollectBlueprints(::buffer_span<::ChunkPos> activeChunks);
81
82 // vIndex: 38
83 virtual void prepareHeights(::BlockVolume&, ::ChunkPos const&, bool) = 0;
84
85 // vIndex: 39
86 virtual void prepareAndComputeHeights(::BlockVolume&, ::ChunkPos const&, ::std::vector<short>&, bool, int) = 0;
87
88 // vIndex: 40
89 virtual ::BiomeArea getBiomeArea(::BoundingBox const&, uint) const = 0;
90
91 // vIndex: 41
92 virtual ::BiomeSource const& getBiomeSource() const = 0;
93
94 // vIndex: 42
95 virtual ::WorldGenerator::BlockVolumeDimensions getBlockVolumeDimensions() const = 0;
96
97 // vIndex: 43
98 virtual ::BlockPos findSpawnPosition() const = 0;
99
100 // vIndex: 44
101 virtual void addHardcodedSpawnAreas(::LevelChunk& lc);
102
103 // vIndex: 13
104 virtual void
105 postProcessMobsAt(::BlockSource& region, int chunkWestBlock, int chunkNorthBlock, ::Random& random) /*override*/;
106
107 // vIndex: 12
108 virtual void postProcessMobsAt(::BlockSource& region, ::BoundingBox const& chunkBB) const /*override*/;
109
110 // vIndex: 1
111 virtual ::std::optional<short> getPreliminarySurfaceLevel(::DividedPos2d<4>) const /*override*/;
112
113 // vIndex: 45
114 virtual void debugRender();
115
116 // vIndex: 46
117 virtual void
118 decorateWorldGenLoadChunk(::Biome const&, ::LevelChunk&, ::BlockVolumeTarget&, ::Random&, ::ChunkPos const&)
119 const = 0;
120
121 // vIndex: 47
122 virtual void decorateWorldGenPostProcess(::Biome const&, ::LevelChunk&, ::BlockSource&, ::Random&) const = 0;
123 // NOLINTEND
124
125public:
126 // member functions
127 // NOLINTBEGIN
128 MCAPI
129 WorldGenerator(::Dimension& dimension, ::std::unique_ptr<::StructureFeatureRegistry> structureFeatureRegistry);
130
131 MCAPI ::std::vector<short> computeChunkHeightMap(::ChunkPos const& pos);
132
133 MCAPI void postProcessStructureFeatures(::BlockSource& region, ::Random& random, int chunkX, int chunkZ);
134
135 MCAPI void postProcessStructures(::BlockSource& region, ::Random& random, int chunkX, int chunkZ);
136
137 MCAPI void preProcessStructures(::Dimension& dimension, ::ChunkPos const& cp, ::BiomeSource const& biomeSource);
138
139 MCAPI void prepareStructureFeatureBlueprints(
140 ::Dimension& dimension,
141 ::ChunkPos const& cp,
142 ::BiomeSource const& biomeSource,
143 ::IPreliminarySurfaceProvider const& preliminarySurfaceProvider
144 );
145
146 MCAPI void waitForStructures();
147 // NOLINTEND
148
149public:
150 // static variables
151 // NOLINTBEGIN
152 MCAPI static uint64 const& TICKING_QUEUE_PASS_LIMIT();
153 // NOLINTEND
154
155public:
156 // constructor thunks
157 // NOLINTBEGIN
158 MCAPI void* $ctor(::Dimension& dimension, ::std::unique_ptr<::StructureFeatureRegistry> structureFeatureRegistry);
159 // NOLINTEND
160
161public:
162 // destructor thunk
163 // NOLINTBEGIN
164 MCAPI void $dtor();
165 // NOLINTEND
166
167public:
168 // virtual function thunks
169 // NOLINTBEGIN
170 MCAPI ::HashedString $findStructureFeatureTypeAt(::BlockPos const& pos);
171
172 MCAPI bool $isStructureFeatureTypeAt(::BlockPos const& pos, ::HashedString type) const;
173
174 MCAPI bool $findNearestStructureFeature(
175 ::HashedString feature,
176 ::BlockPos const& origin,
177 ::BlockPos& pos,
178 bool mustBeInNewChunks,
179 ::std::optional<::HashedString> biomeTag
180 );
181
182 MCAPI void $garbageCollectBlueprints(::buffer_span<::ChunkPos> activeChunks);
183
184 MCAPI void $addHardcodedSpawnAreas(::LevelChunk& lc);
185
186 MCAPI void $postProcessMobsAt(::BlockSource& region, int chunkWestBlock, int chunkNorthBlock, ::Random& random);
187
188 MCAPI void $postProcessMobsAt(::BlockSource& region, ::BoundingBox const& chunkBB) const;
189
190 MCAPI ::std::optional<short> $getPreliminarySurfaceLevel(::DividedPos2d<4>) const;
191
192 MCAPI void $debugRender();
193 // NOLINTEND
194
195public:
196 // vftables
197 // NOLINTBEGIN
198 MCAPI static void** $vftableForIPreliminarySurfaceProvider();
199
200 MCAPI static void** $vftableForChunkSource();
201 // NOLINTEND
202};
Definition BiomeArea.h:11
Definition BiomeSource.h:16
Definition Biome.h:27
Definition BlockPos.h:18
Definition BlockSource.h:67
Definition BlockVolumeTarget.h:24
Definition BlockVolume.h:11
Definition BoundingBox.h:18
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:73
Definition Random.h:16
Definition StructureFeatureRegistry.h:17
Definition WorldGenerator.h:30
Definition buffer_span.h:6
Definition WorldGenerator.h:38