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