LeviLamina
Loading...
Searching...
No Matches
CaveFeature.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/math/Vec3.h"
7#include "mc/platform/threading/Mutex.h"
8#include "mc/util/FloatRange.h"
9#include "mc/util/molang/ExpressionNode.h"
10#include "mc/world/level/levelgen/feature/IFeature.h"
11#include "mc/world/level/levelgen/feature/cave_feature_utils/CarvingParameters.h"
12
13// auto generated forward declare list
14// clang-format off
15class Block;
16class BlockPos;
17class BoundingBox;
18class ChunkPos;
20class Random;
21class RenderParams;
22struct WorldGenContext;
23namespace CaveFeatureUtils { struct CarverConfiguration; }
24// clang-format on
25
26class CaveFeature : public ::IFeature {
27public:
28 // CaveFeature inner types declare
29 // clang-format off
30 struct CachedMetaData;
31 // clang-format on
32
33 // CaveFeature inner types define
35 public:
36 // CachedMetaData inner types declare
37 // clang-format off
39 // clang-format on
40
41 // CachedMetaData inner types define
43 public:
44 // member variables
45 // NOLINTBEGIN
46 ::ll::TypedStorage<4, 12, ::Vec3 const> mStartPos;
47 ::ll::TypedStorage<4, 4, float const> mHorizontalRadius;
48 ::ll::TypedStorage<4, 4, float const> mVerticalRadius;
49 ::ll::TypedStorage<4, 24, ::CaveFeatureUtils::CarvingParameters const> mCarvingParameters;
50 ::ll::TypedStorage<4, 4, int const> mCurrentStep;
51 ::ll::TypedStorage<4, 4, int const> mTotalSteps;
52 ::ll::TypedStorage<4, 4, float const> mThickness;
53 // NOLINTEND
54 };
55
56 public:
57 // member variables
58 // NOLINTBEGIN
59 ::ll::TypedStorage<4, 4, ::std::atomic<uint>> mUseCount;
60 ::ll::TypedStorage<8, 24, ::std::vector<::CaveFeature::CachedMetaData::CarveEllipsoidParams>>
61 mCarveEllipsoidParamsVector;
62 // NOLINTEND
63 };
64
65public:
66 // member variables
67 // NOLINTBEGIN
68 ::ll::TypedStorage<8, 8, ::Block const*> mFillWithBlock;
69 ::ll::TypedStorage<8, 16, ::ExpressionNode> mWidthMod;
70 ::ll::TypedStorage<4, 4, int> mSkipCarveChance;
71 ::ll::TypedStorage<4, 4, int> mHeightLimit;
72 ::ll::TypedStorage<4, 8, ::FloatRange> mYScale;
73 ::ll::TypedStorage<4, 8, ::FloatRange> mHorizontalRadiusMultiplier;
74 ::ll::TypedStorage<4, 8, ::FloatRange> mVerticalRadiusMultiplier;
75 ::ll::TypedStorage<4, 8, ::FloatRange> mFloorLevel;
76 ::ll::TypedStorage<8, 32, ::std::string const> VALID_PASS;
77 ::ll::TypedStorage<4, 4, float const> X_DAMPENING_FACTOR;
78 ::ll::TypedStorage<4, 4, float const> Y_DAMPENING_FACTOR;
79 ::ll::TypedStorage<4, 4, float const> STEEP_FLATTENING_FACTOR;
80 ::ll::TypedStorage<4, 4, float const> FLATTENING_FACTOR;
81 ::ll::TypedStorage<4, 4, int const> STEEP_CHANCE;
82 ::ll::TypedStorage<4, 4, int const> TUNNEL_SKIP_CHANCE;
83 ::ll::TypedStorage<4, 4, int const> CAVE_COUNT_BASE_FACTOR;
84 ::ll::TypedStorage<4, 4, int const> ROOM_CARVE_CHANCE;
85 ::ll::TypedStorage<4, 4, int const> MAX_NUM_TUNNELS_ADDED_ON_ROOM_CARVE;
86 ::ll::TypedStorage<1, 1, bool> mCacheEnabled;
87 ::ll::TypedStorage<
88 8,
89 64,
90 ::std::unordered_map<int, ::std::unordered_map<int, ::std::shared_ptr<::CaveFeature::CachedMetaData>>>>
91 mCachedMetaDataMap;
92 ::ll::TypedStorage<8, 80, ::Bedrock::Threading::Mutex> mCacheMutex;
93 ::ll::TypedStorage<4, 4, ::std::atomic<uint>> mPlaceCount;
94 // NOLINTEND
95
96public:
97 // virtual functions
98 // NOLINTBEGIN
99 virtual ~CaveFeature() /*override*/;
100
101 virtual ::std::optional<::BlockPos> place(::IFeature::PlacementContext const& context) const /*override*/;
102
103 virtual bool isValidPlacement(::std::string const& pass) /*override*/;
104
105 virtual void addRoom(
106 ::IBlockWorldGenAPI& target,
107 ::CaveFeatureUtils::CarverConfiguration const& configuration,
108 ::Random& random,
109 ::ChunkPos const& chunkPos,
110 ::Vec3 const& startPos,
111 ::RenderParams& renderParams,
112 ::CaveFeatureUtils::CarvingParameters const& carvingParameters,
113 ::std::vector<::CaveFeature::CachedMetaData::CarveEllipsoidParams>& carveParamsOperations
114 ) const;
115
116 virtual void addTunnel(
117 ::IBlockWorldGenAPI& target,
118 ::CaveFeatureUtils::CarverConfiguration const& configuration,
119 ::Random& random,
120 ::ChunkPos const& chunkPos,
121 ::Vec3 const& startPos,
122 float thickness,
123 float horizontalRotation,
124 float verticalRotation,
125 int step,
126 int dist,
127 float yScale,
128 ::RenderParams& renderParams,
129 ::CaveFeatureUtils::CarvingParameters const& carvingParameters,
130 ::std::vector<::CaveFeature::CachedMetaData::CarveEllipsoidParams>& carveParamsOperations
131 ) const;
132
133 virtual bool carveEllipsoidVolume(
134 ::IBlockWorldGenAPI& target,
135 ::CaveFeatureUtils::CarverConfiguration const& configuration,
136 ::Random& chunkPos,
137 ::ChunkPos const& startPos,
138 ::Vec3 const& volume,
139 ::BoundingBox const& rad,
140 float yRad,
141 float carvingParameters,
143 ) const;
144
145 virtual void addFeature(
146 ::IBlockWorldGenAPI& target,
147 ::ChunkPos const& pos,
148 ::Random& random,
149 ::ChunkPos const& startChunk,
150 ::RenderParams& renderParams,
151 ::std::vector<::CaveFeature::CachedMetaData::CarveEllipsoidParams>& carveParamsOperations
152 ) const;
153 // NOLINTEND
154
155public:
156 // member functions
157 // NOLINTBEGIN
158 MCAPI CaveFeature();
159
160 MCAPI bool _thinSand(::IBlockWorldGenAPI& target, ::BlockPos aboveBlockPos, int currentYIndex) const;
161
162 MCAPI bool carveBlock(
163 ::IBlockWorldGenAPI& target,
164 ::CaveFeatureUtils::CarverConfiguration const& configuration,
165 ::BlockPos currentBlockPos,
166 bool carved,
167 ::Vec3 const& originalStartPos,
168 int currentYIndex,
169 ::BlockPos worldPos
170 ) const;
171
172 MCAPI bool carveEllipsoid(
173 ::IBlockWorldGenAPI& target,
174 ::CaveFeatureUtils::CarverConfiguration const& configuration,
175 ::Random& random,
176 ::ChunkPos const& chunkPos,
177 ::Vec3 const& startPos,
178 float horizontalRadius,
179 float verticalRadius,
180 ::CaveFeatureUtils::CarvingParameters const& carvingParameters
181 ) const;
182
183 MCAPI bool detectWater(::IBlockWorldGenAPI& target, ::BoundingBox const& volume) const;
184
185 MCAPI ::Block const* getBlockToFill(::BlockPos currentPos, ::WorldGenContext const& context) const;
186
187 MCAPI float getWidthModifier(::RenderParams& renderParams) const;
188 // NOLINTEND
189
190public:
191 // static functions
192 // NOLINTBEGIN
193 MCAPI static bool shouldSkipCarving(float yd, float xd_sq, float yd_sq, float zd_sq, float floorLevel);
194 // NOLINTEND
195
196public:
197 // constructor thunks
198 // NOLINTBEGIN
199 MCAPI void* $ctor();
200 // NOLINTEND
201
202public:
203 // destructor thunk
204 // NOLINTBEGIN
205 MCAPI void $dtor();
206 // NOLINTEND
207
208public:
209 // virtual function thunks
210 // NOLINTBEGIN
211 MCAPI ::std::optional<::BlockPos> $place(::IFeature::PlacementContext const& context) const;
212
213 MCAPI bool $isValidPlacement(::std::string const& pass);
214
215 MCAPI void $addRoom(
216 ::IBlockWorldGenAPI& target,
217 ::CaveFeatureUtils::CarverConfiguration const& configuration,
218 ::Random& random,
219 ::ChunkPos const& chunkPos,
220 ::Vec3 const& startPos,
221 ::RenderParams& renderParams,
222 ::CaveFeatureUtils::CarvingParameters const& carvingParameters,
223 ::std::vector<::CaveFeature::CachedMetaData::CarveEllipsoidParams>& carveParamsOperations
224 ) const;
225
226 MCAPI void $addTunnel(
227 ::IBlockWorldGenAPI& target,
228 ::CaveFeatureUtils::CarverConfiguration const& configuration,
229 ::Random& random,
230 ::ChunkPos const& chunkPos,
231 ::Vec3 const& startPos,
232 float thickness,
233 float horizontalRotation,
234 float verticalRotation,
235 int step,
236 int dist,
237 float yScale,
238 ::RenderParams& renderParams,
239 ::CaveFeatureUtils::CarvingParameters const& carvingParameters,
240 ::std::vector<::CaveFeature::CachedMetaData::CarveEllipsoidParams>& carveParamsOperations
241 ) const;
242
243 MCAPI bool $carveEllipsoidVolume(
244 ::IBlockWorldGenAPI& target,
245 ::CaveFeatureUtils::CarverConfiguration const& configuration,
246 ::Random& chunkPos,
247 ::ChunkPos const& startPos,
248 ::Vec3 const& volume,
249 ::BoundingBox const& rad,
250 float yRad,
251 float carvingParameters,
253 ) const;
254
255 MCAPI void $addFeature(
256 ::IBlockWorldGenAPI& target,
257 ::ChunkPos const& pos,
258 ::Random& random,
259 ::ChunkPos const& startChunk,
260 ::RenderParams& renderParams,
261 ::std::vector<::CaveFeature::CachedMetaData::CarveEllipsoidParams>& carveParamsOperations
262 ) const;
263
264
265 // NOLINTEND
266
267public:
268 // vftables
269 // NOLINTBEGIN
270 MCNAPI static void** $vftable();
271 // NOLINTEND
272};
Definition BlockPos.h:21
Definition Block.h:69
Definition BoundingBox.h:13
static MCAPI void ** $vftable()
Definition ChunkPos.h:11
Definition IBlockWorldGenAPI.h:25
Definition IFeature.h:19
Definition Random.h:10
Definition RenderParams.h:30
Definition Vec3.h:10
Definition CarverConfiguration.h:14
Definition CarvingParameters.h:10
Definition CaveFeature.h:34
Definition IFeature.h:27
Definition WorldGenContext.h:13
Definition context.h:5