LeviLamina
Loading...
Searching...
No Matches
MultifaceBlock.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/utility/optional_ref.h"
7#include "mc/world/level/ShapeType.h"
8#include "mc/world/level/block/BlockType.h"
9
10// auto generated forward declare list
11// clang-format off
12class AABB;
13class Actor;
14class Block;
15class BlockPos;
16class BlockSource;
18class HitResult;
21class Material;
23class Vec3;
24namespace BlockEvents { class BlockQueuedTickEvent; }
25// clang-format on
26
27class MultifaceBlock : public ::BlockType {
28public:
29 // member variables
30 // NOLINTBEGIN
31 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::MultifaceSpreader const>> mSpreader;
32 // NOLINTEND
33
34public:
35 // prevent constructor by default
36 MultifaceBlock();
37
38public:
39 // virtual functions
40 // NOLINTBEGIN
41 virtual ~MultifaceBlock() /*override*/;
42
43 virtual ::AABB const&
44 getVisualShapeInWorld(::Block const& block, ::IConstBlockSource const& bufferAABB, ::BlockPos const&, ::AABB&) const
45 /*override*/;
46
47 virtual ::AABB getCollisionShape(
48 ::Block const&,
50 ::BlockPos const&,
52 ) const /*override*/;
53
54 virtual ::AABB const& getOutline(
55 ::Block const& block,
56 ::IConstBlockSource const& region,
57 ::BlockPos const& pos,
58 ::AABB& bufferValue
59 ) const /*override*/;
60
61 virtual ::HitResult clip(
62 ::Block const& block,
63 ::BlockSource const& region,
64 ::BlockPos const& pos,
65 ::Vec3 const& A,
66 ::Vec3 const& B,
67 ::ShapeType shapeType,
69 ) const /*override*/;
70
71 virtual ::Block const&
72 getPlacementBlock(::Actor const& by, ::BlockPos const& pos, uchar face, ::Vec3 const& clickPos, int itemValue) const
73 /*override*/;
74
75 virtual void neighborChanged(::BlockSource& region, ::BlockPos const& pos, ::BlockPos const& neighborPos) const
76 /*override*/;
77
78 virtual bool canSurvive(::BlockSource& region, ::BlockPos const& pos) const /*override*/;
79
80 virtual bool mayPlace(::BlockSource& region, ::BlockPos const& pos, uchar face) const /*override*/;
81
82 virtual bool isMultifaceBlock() const /*override*/;
83
84 virtual bool isLavaBlocking() const /*override*/;
85
86 virtual ::Block const& sanitizeFillBlock(::Block const& block) const /*override*/;
87 // NOLINTEND
88
89public:
90 // member functions
91 // NOLINTBEGIN
92 MCAPI MultifaceBlock(::std::string const& nameId, int id, ::Material const& material);
93
94 MCAPI MultifaceBlock(
95 ::std::string const& nameId,
96 int id,
97 ::Material const& material,
98 ::std::unique_ptr<::MultifaceSpreader const> spreader
99 );
100
101 MCAPI bool
102 _canSpread(::IBlockWorldGenAPI& target, ::Block const& block, ::BlockPos const& pos, uchar startingFace) const;
103
104 MCAPI void _removeBlock(
105 ::IBlockWorldGenAPI& target,
106 ::BlockSource* region,
107 ::BlockPos const& pos,
108 bool canSpawnParticles
109 ) const;
110
111 MCAPI void removeFace(
112 ::IBlockWorldGenAPI& target,
113 ::BlockSource* region,
114 ::Block const& block,
115 ::BlockPos const& pos,
116 uchar faceDirection,
117 bool canSpawnParticles
118 ) const;
119
120 MCAPI void tick(::BlockEvents::BlockQueuedTickEvent& eventData) const;
121 // NOLINTEND
122
123public:
124 // static functions
125 // NOLINTBEGIN
126 MCAPI static int _getNumSides(::Block const& block);
127
128 MCAPI static bool _hasAnyFace(::Block const& block);
129
130 MCAPI static bool _hasAnyVacantFace(::Block const& block);
131
132 MCAPI static int convertOldMultifaceToNewMultifaceValue(int oldMultifaceDirections);
133
134 MCAPI static ::Block const& getBlockForPlacement(
135 ::Block const& oldBlock,
136 ::Block const& placementBlock,
137 ::BlockSource& region,
138 ::BlockPos const& placementPos,
139 uchar placementDirection
140 );
141
142 MCAPI static ::Block const& getBlockForPlacementOrFillMoreFaces(
143 ::Block const& oldBlock,
144 ::Block const& placementBlock,
145 ::BlockSource& region,
146 ::BlockPos const& placementPos,
147 uchar placementDirection
148 );
149
150 MCAPI static ::Block const& getBlockForPlacementWorldGen(
151 ::Block const& oldBlock,
152 ::Block const& placementBlock,
153 ::IBlockWorldGenAPI& region,
154 ::BlockPos const& placementPos,
155 uchar placementDirection
156 );
157
158#ifdef LL_PLAT_C
159 MCAPI static ::std::vector<uchar> getFacingListFromMask(uchar faceDirectionBits);
160#endif
161
162 MCAPI static bool hasFace(::Block const& block, uchar faceDirection);
163 // NOLINTEND
164
165public:
166 // static variables
167 // NOLINTBEGIN
168 MCAPI static int const& MULTIFACE_ALL();
169
170 MCAPI static int const& MULTIFACE_DOWN();
171
172 MCAPI static int const& MULTIFACE_EAST();
173
174 MCAPI static int const& MULTIFACE_NORTH();
175
176 MCAPI static int const& MULTIFACE_SIDES();
177
178 MCAPI static int const& MULTIFACE_SOUTH();
179
180 MCAPI static int const& MULTIFACE_UP();
181
182 MCAPI static int const& MULTIFACE_WEST();
183 // NOLINTEND
184
185public:
186 // constructor thunks
187 // NOLINTBEGIN
188 MCAPI void* $ctor(::std::string const& nameId, int id, ::Material const& material);
189
190 MCAPI void* $ctor(
191 ::std::string const& nameId,
192 int id,
193 ::Material const& material,
194 ::std::unique_ptr<::MultifaceSpreader const> spreader
195 );
196 // NOLINTEND
197
198public:
199 // destructor thunk
200 // NOLINTBEGIN
201 MCAPI void $dtor();
202 // NOLINTEND
203
204public:
205 // virtual function thunks
206 // NOLINTBEGIN
207 MCAPI ::AABB const& $getVisualShapeInWorld(
208 ::Block const& block,
209 ::IConstBlockSource const& bufferAABB,
210 ::BlockPos const&,
211 ::AABB&
212 ) const;
213
214 MCFOLD ::AABB $getCollisionShape(
215 ::Block const&,
216 ::IConstBlockSource const&,
217 ::BlockPos const&,
219 ) const;
220
221 MCFOLD ::AABB const& $getOutline(
222 ::Block const& block,
223 ::IConstBlockSource const& region,
224 ::BlockPos const& pos,
225 ::AABB& bufferValue
226 ) const;
227
228 MCAPI ::HitResult $clip(
229 ::Block const& block,
230 ::BlockSource const& region,
231 ::BlockPos const& pos,
232 ::Vec3 const& A,
233 ::Vec3 const& B,
234 ::ShapeType shapeType,
236 ) const;
237
238 MCAPI ::Block const& $getPlacementBlock(
239 ::Actor const& by,
240 ::BlockPos const& pos,
241 uchar face,
242 ::Vec3 const& clickPos,
243 int itemValue
244 ) const;
245
246 MCFOLD void $neighborChanged(::BlockSource& region, ::BlockPos const& pos, ::BlockPos const& neighborPos) const;
247
248 MCAPI bool $canSurvive(::BlockSource& region, ::BlockPos const& pos) const;
249
250 MCAPI bool $mayPlace(::BlockSource& region, ::BlockPos const& pos, uchar face) const;
251
252 MCFOLD bool $isMultifaceBlock() const;
253
254 MCFOLD bool $isLavaBlocking() const;
255
256 MCAPI ::Block const& $sanitizeFillBlock(::Block const& block) const;
257
258
259 // NOLINTEND
260
261public:
262 // vftables
263 // NOLINTBEGIN
264 MCAPI static void** $vftable();
265 // NOLINTEND
266};
Definition AABB.h:18
Definition Actor.h:125
Definition BlockQueuedTickEvent.h:18
Definition BlockPos.h:21
Definition BlockSource.h:73
Definition Block.h:69
Definition GetCollisionShapeInterface.h:13
Definition HitResult.h:19
Definition IBlockWorldGenAPI.h:25
Definition IConstBlockSource.h:24
Definition Material.h:8
Definition MultifaceSpreader.h:13
Definition Vec3.h:10
Definition optional_ref.h:10