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*/ = default;
42
43 virtual ::AABB const&
44 getVisualShapeInWorld(::Block const& block, ::IConstBlockSource const&, ::BlockPos const&, ::AABB& bufferAABB) 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(
93 ::std::string const& nameId,
94 int id,
95 ::Material const& material,
96 ::std::unique_ptr<::MultifaceSpreader const> spreader
97 );
98
99 MCAPI bool
100 _canSpread(::IBlockWorldGenAPI& target, ::Block const& block, ::BlockPos const& pos, uchar startingFace) const;
101
102 MCAPI void removeFace(
103 ::IBlockWorldGenAPI& target,
104 ::BlockSource* region,
105 ::Block const& block,
106 ::BlockPos const& pos,
107 uchar faceDirection,
108 bool canSpawnParticles
109 ) const;
110
111 MCAPI void tick(::BlockEvents::BlockQueuedTickEvent& eventData) const;
112 // NOLINTEND
113
114public:
115 // static functions
116 // NOLINTBEGIN
117 MCAPI static int _getNumSides(::Block const& block);
118
119 MCAPI static bool _hasAnyFace(::Block const& block);
120
121 MCAPI static ::Block const& getBlockForPlacementWorldGen(
122 ::Block const& oldBlock,
123 ::Block const& placementBlock,
124 ::IBlockWorldGenAPI& region,
125 ::BlockPos const& placementPos,
126 uchar placementDirection
127 );
128
129#ifdef LL_PLAT_C
130 MCAPI static ::std::vector<uchar> getFacingListFromMask(uchar faceDirectionBits);
131#endif
132
133 MCAPI static bool hasFace(::Block const& block, uchar faceDirection);
134 // NOLINTEND
135
136public:
137 // static variables
138 // NOLINTBEGIN
139 MCAPI static int const& MULTIFACE_ALL();
140
141 MCAPI static int const& MULTIFACE_DOWN();
142
143 MCAPI static int const& MULTIFACE_EAST();
144
145 MCAPI static int const& MULTIFACE_NORTH();
146
147 MCAPI static int const& MULTIFACE_SIDES();
148
149 MCAPI static int const& MULTIFACE_SOUTH();
150
151 MCAPI static int const& MULTIFACE_UP();
152
153 MCAPI static int const& MULTIFACE_WEST();
154 // NOLINTEND
155
156public:
157 // constructor thunks
158 // NOLINTBEGIN
159 MCAPI void* $ctor(
160 ::std::string const& nameId,
161 int id,
162 ::Material const& material,
163 ::std::unique_ptr<::MultifaceSpreader const> spreader
164 );
165 // NOLINTEND
166
167public:
168 // virtual function thunks
169 // NOLINTBEGIN
170 MCAPI ::AABB const& $getVisualShapeInWorld(
171 ::Block const& block,
172 ::IConstBlockSource const&,
173 ::BlockPos const&,
174 ::AABB& bufferAABB
175 ) const;
176
177 MCFOLD ::AABB $getCollisionShape(
178 ::Block const&,
179 ::IConstBlockSource const&,
180 ::BlockPos const&,
182 ) const;
183
184 MCFOLD ::AABB const& $getOutline(
185 ::Block const& block,
186 ::IConstBlockSource const& region,
187 ::BlockPos const& pos,
188 ::AABB& bufferValue
189 ) const;
190
191 MCAPI ::HitResult $clip(
192 ::Block const& block,
193 ::BlockSource const& region,
194 ::BlockPos const& pos,
195 ::Vec3 const& A,
196 ::Vec3 const& B,
197 ::ShapeType shapeType,
199 ) const;
200
201 MCAPI ::Block const& $getPlacementBlock(
202 ::Actor const& by,
203 ::BlockPos const& pos,
204 uchar face,
205 ::Vec3 const& clickPos,
206 int itemValue
207 ) const;
208
209 MCFOLD void $neighborChanged(::BlockSource& region, ::BlockPos const& pos, ::BlockPos const& neighborPos) const;
210
211 MCAPI bool $canSurvive(::BlockSource& region, ::BlockPos const& pos) const;
212
213 MCAPI bool $mayPlace(::BlockSource& region, ::BlockPos const& pos, uchar face) const;
214
215 MCFOLD bool $isMultifaceBlock() const;
216
217 MCFOLD bool $isLavaBlocking() const;
218
219 MCAPI ::Block const& $sanitizeFillBlock(::Block const& block) const;
220
221
222 // NOLINTEND
223
224public:
225 // vftables
226 // NOLINTBEGIN
227 MCAPI static void** $vftable();
228 // NOLINTEND
229};
Definition AABB.h:18
Definition Actor.h:113
Definition BlockQueuedTickEvent.h:16
Definition BlockPos.h:17
Definition BlockSource.h:71
Definition Block.h:41
Definition GetCollisionShapeInterface.h:13
Definition HitResult.h:18
Definition IBlockWorldGenAPI.h:25
Definition IConstBlockSource.h:25
Definition Material.h:8
Definition MultifaceSpreader.h:13
Definition Vec3.h:10
Definition optional_ref.h:10