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 // vIndex: 0
99 virtual ~CaveFeature() /*override*/ = default;
100
101 // vIndex: 1
102 virtual ::std::optional<::BlockPos> place(::IFeature::PlacementContext const& context) const /*override*/;
103
104 // vIndex: 2
105 virtual bool isValidPlacement(::std::string const& pass) /*override*/;
106
107 // vIndex: 4
108 virtual void addRoom(
109 ::IBlockWorldGenAPI& target,
110 ::CaveFeatureUtils::CarverConfiguration const& configuration,
111 ::Random& random,
112 ::ChunkPos const& chunkPos,
113 ::Vec3 const& startPos,
114 ::RenderParams& renderParams,
115 ::CaveFeatureUtils::CarvingParameters const& carvingParameters,
116 ::std::vector<::CaveFeature::CachedMetaData::CarveEllipsoidParams>& carveParamsOperations
117 ) const;
118
119 // vIndex: 5
120 virtual void addTunnel(
121 ::IBlockWorldGenAPI& target,
122 ::CaveFeatureUtils::CarverConfiguration const& configuration,
123 ::Random& random,
124 ::ChunkPos const& chunkPos,
125 ::Vec3 const& startPos,
126 float thickness,
127 float horizontalRotation,
128 float verticalRotation,
129 int step,
130 int dist,
131 float yScale,
132 ::RenderParams& renderParams,
133 ::CaveFeatureUtils::CarvingParameters const& carvingParameters,
134 ::std::vector<::CaveFeature::CachedMetaData::CarveEllipsoidParams>& carveParamsOperations
135 ) const;
136
137 // vIndex: 6
138 virtual bool carveEllipsoidVolume(
139 ::IBlockWorldGenAPI& target,
140 ::CaveFeatureUtils::CarverConfiguration const& configuration,
141 ::Random&,
142 ::ChunkPos const& chunkPos,
143 ::Vec3 const& startPos,
144 ::BoundingBox const& volume,
145 float rad,
146 float yRad,
147 ::CaveFeatureUtils::CarvingParameters const& carvingParameters
148 ) const;
149
150 // vIndex: 7
151 virtual void addFeature(
152 ::IBlockWorldGenAPI& target,
153 ::ChunkPos const& pos,
154 ::Random& random,
155 ::ChunkPos const& startChunk,
156 ::RenderParams& renderParams,
157 ::std::vector<::CaveFeature::CachedMetaData::CarveEllipsoidParams>& carveParamsOperations
158 ) const;
159 // NOLINTEND
160
161public:
162 // member functions
163 // NOLINTBEGIN
164 MCAPI CaveFeature();
165
166 MCAPI bool carveBlock(
167 ::IBlockWorldGenAPI& target,
168 ::CaveFeatureUtils::CarverConfiguration const& configuration,
169 ::BlockPos currentBlockPos,
170 bool carved,
171 ::Vec3 const& originalStartPos,
172 int currentYIndex,
173 ::BlockPos worldPos
174 ) const;
175
176 MCAPI bool carveEllipsoid(
177 ::IBlockWorldGenAPI& target,
178 ::CaveFeatureUtils::CarverConfiguration const& configuration,
179 ::Random& random,
180 ::ChunkPos const& chunkPos,
181 ::Vec3 const& startPos,
182 float horizontalRadius,
183 float verticalRadius,
184 ::CaveFeatureUtils::CarvingParameters const& carvingParameters
185 ) const;
186
187 MCAPI bool detectWater(::IBlockWorldGenAPI& target, ::BoundingBox const& volume) const;
188 // NOLINTEND
189
190public:
191 // constructor thunks
192 // NOLINTBEGIN
193 MCAPI void* $ctor();
194 // NOLINTEND
195
196public:
197 // virtual function thunks
198 // NOLINTBEGIN
199 MCAPI ::std::optional<::BlockPos> $place(::IFeature::PlacementContext const& context) const;
200
201 MCAPI bool $isValidPlacement(::std::string const& pass);
202
203 MCAPI void $addRoom(
204 ::IBlockWorldGenAPI& target,
205 ::CaveFeatureUtils::CarverConfiguration const& configuration,
206 ::Random& random,
207 ::ChunkPos const& chunkPos,
208 ::Vec3 const& startPos,
209 ::RenderParams& renderParams,
210 ::CaveFeatureUtils::CarvingParameters const& carvingParameters,
211 ::std::vector<::CaveFeature::CachedMetaData::CarveEllipsoidParams>& carveParamsOperations
212 ) const;
213
214 MCAPI void $addTunnel(
215 ::IBlockWorldGenAPI& target,
216 ::CaveFeatureUtils::CarverConfiguration const& configuration,
217 ::Random& random,
218 ::ChunkPos const& chunkPos,
219 ::Vec3 const& startPos,
220 float thickness,
221 float horizontalRotation,
222 float verticalRotation,
223 int step,
224 int dist,
225 float yScale,
226 ::RenderParams& renderParams,
227 ::CaveFeatureUtils::CarvingParameters const& carvingParameters,
228 ::std::vector<::CaveFeature::CachedMetaData::CarveEllipsoidParams>& carveParamsOperations
229 ) const;
230
231 MCAPI bool $carveEllipsoidVolume(
232 ::IBlockWorldGenAPI& target,
233 ::CaveFeatureUtils::CarverConfiguration const& configuration,
234 ::Random&,
235 ::ChunkPos const& chunkPos,
236 ::Vec3 const& startPos,
237 ::BoundingBox const& volume,
238 float rad,
239 float yRad,
240 ::CaveFeatureUtils::CarvingParameters const& carvingParameters
241 ) const;
242
243 MCAPI void $addFeature(
244 ::IBlockWorldGenAPI& target,
245 ::ChunkPos const& pos,
246 ::Random& random,
247 ::ChunkPos const& startChunk,
248 ::RenderParams& renderParams,
249 ::std::vector<::CaveFeature::CachedMetaData::CarveEllipsoidParams>& carveParamsOperations
250 ) const;
251 // NOLINTEND
252
253public:
254 // vftables
255 // NOLINTBEGIN
256 MCNAPI static void** $vftable();
257 // NOLINTEND
258};
Definition BlockPos.h:17
Definition Block.h:37
Definition BoundingBox.h:13
Definition CaveFeature.h:25
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