Skip to content
LeviMC
English
AutoLightDark
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
93 ::std::string const& nameId,
94 int id,
95 ::Material const& material,
96 ::std::unique_ptr<::MultifaceSpreader const> spreader
97 );
98
99 MCNAPI bool
100 _canSpread(::IBlockWorldGenAPI& target, ::Block const& block, ::BlockPos const& pos, uchar startingFace) const;
101
102 MCNAPI 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 MCNAPI void tick(::BlockEvents::BlockQueuedTickEvent& eventData) const;
112 // NOLINTEND
113
114public:
115 // static functions
116 // NOLINTBEGIN
117 MCNAPI static int _getNumSides(::Block const& block);
118
119 MCNAPI static bool _hasAnyFace(::Block const& block);
120
121 MCNAPI 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 MCNAPI static ::std::vector<uchar> getFacingListFromMask(uchar faceDirectionBits);
131#endif
132
133 MCNAPI static bool hasFace(::Block const& block, uchar faceDirection);
134 // NOLINTEND
135
136public:
137 // static variables
138 // NOLINTBEGIN
139 MCNAPI 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 MCNAPI 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 MCNAPI 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 MCNAPI ::AABB const& $getVisualShapeInWorld(
171 ::Block const& block,
172 ::IConstBlockSource const&,
173 ::BlockPos const&,
174 ::AABB& bufferAABB
175 ) const;
176
177 MCNAPI ::AABB $getCollisionShape(
178 ::Block const&,
179 ::IConstBlockSource const&,
180 ::BlockPos const&,
182 ) const;
183
184 MCNAPI ::AABB const& $getOutline(
185 ::Block const& block,
186 ::IConstBlockSource const& region,
187 ::BlockPos const& pos,
188 ::AABB& bufferValue
189 ) const;
190
191 MCNAPI ::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 MCNAPI ::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 MCNAPI void $neighborChanged(::BlockSource& region, ::BlockPos const& pos, ::BlockPos const& neighborPos) const;
210
211 MCNAPI bool $canSurvive(::BlockSource& region, ::BlockPos const& pos) const;
212
213 MCNAPI bool $mayPlace(::BlockSource& region, ::BlockPos const& pos, uchar face) const;
214
215 MCNAPI bool $isMultifaceBlock() const;
216
217 MCNAPI bool $isLavaBlocking() const;
218
219 MCNAPI ::Block const& $sanitizeFillBlock(::Block const& block) const;
220
221
222 // NOLINTEND
223
224public:
225 // vftables
226 // NOLINTBEGIN
227 MCNAPI static void** $vftable();
228 // NOLINTEND
229};
Definition AABB.h:18
Definition Actor.h:116
Definition BlockQueuedTickEvent.h:16
Definition BlockPos.h:14
Definition BlockSource.h:72
Definition Block.h:42
Definition GetCollisionShapeInterface.h:13
Definition HitResult.h:18
Definition IBlockWorldGenAPI.h:25
Definition IConstBlockSource.h:25
Definition Material.h:8
MCAPI::AABB $getCollisionShape(::Block const &, ::IConstBlockSource const &, ::BlockPos const &, ::optional_ref<::GetCollisionShapeInterface const >) const
MCAPI bool $canSurvive(::BlockSource &region, ::BlockPos const &pos) const
MCAPI void removeFace(::IBlockWorldGenAPI &target, ::BlockSource *region, ::Block const &block, ::BlockPos const &pos, uchar faceDirection, bool canSpawnParticles) const
MCAPI MultifaceBlock(::std::string const &nameId, int id, ::Material const &material, ::std::unique_ptr<::MultifaceSpreader const > spreader)
MCAPI void $neighborChanged(::BlockSource &region, ::BlockPos const &pos, ::BlockPos const &neighborPos) const
static MCAPI bool _hasAnyFace(::Block const &block)
static MCAPI int _getNumSides(::Block const &block)
MCAPI::Block const & $getPlacementBlock(::Actor const &by, ::BlockPos const &pos, uchar face, ::Vec3 const &clickPos, int itemValue) const
MCAPI::HitResult $clip(::Block const &block, ::BlockSource const &region, ::BlockPos const &pos, ::Vec3 const &A, ::Vec3 const &B, ::ShapeType shapeType, ::optional_ref<::GetCollisionShapeInterface const > entity) const
MCAPI void * $ctor(::std::string const &nameId, int id, ::Material const &material, ::std::unique_ptr<::MultifaceSpreader const > spreader)
MCAPI bool $isMultifaceBlock() const
static MCAPI ::Block const & getBlockForPlacementWorldGen(::Block const &oldBlock, ::Block const &placementBlock, ::IBlockWorldGenAPI &region, ::BlockPos const &placementPos, uchar placementDirection)
MCAPI void tick(::BlockEvents::BlockQueuedTickEvent &eventData) const
MCAPI::Block const & $sanitizeFillBlock(::Block const &block) const
MCAPI bool $isLavaBlocking() const
MCAPI::AABB const & $getVisualShapeInWorld(::Block const &block, ::IConstBlockSource const &, ::BlockPos const &, ::AABB &bufferAABB) const
MCAPI bool _canSpread(::IBlockWorldGenAPI &target, ::Block const &block, ::BlockPos const &pos, uchar startingFace) const
MCAPI::AABB const & $getOutline(::Block const &block, ::IConstBlockSource const &region, ::BlockPos const &pos, ::AABB &bufferValue) const
static MCAPI bool hasFace(::Block const &block, uchar faceDirection)
MCAPI bool $mayPlace(::BlockSource &region, ::BlockPos const &pos, uchar face) const
static MCAPI int const & MULTIFACE_SIDES()
static MCAPI int const & MULTIFACE_ALL()
static MCAPI void ** $vftable()
Definition MultifaceSpreader.h:13
Definition Vec3.h:10
Definition optional_ref.h:10