LeviLamina
Loading...
Searching...
No Matches
DoorBlock.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/Direction.h"
8#include "mc/world/level/block/BlockSupportType.h"
9#include "mc/world/level/block/BlockType.h"
10
11// auto generated forward declare list
12// clang-format off
13class AABB;
14class Actor;
15class Block;
16class BlockActor;
17class BlockPos;
18class BlockSource;
21class ItemInstance;
22class Material;
23class Player;
24namespace BlockEvents { class BlockPlayerInteractEvent; }
25namespace BlockEvents { class BlockQueuedTickEvent; }
26namespace BlockEvents { class BlockRedstoneUpdateEvent; }
27// clang-format on
28
29class DoorBlock : public ::BlockType {
30public:
31 // DoorBlock inner types define
32 enum class DoorType : int {
33 Oak = 0,
34 Spruce = 1,
35 Birch = 2,
36 Jungle = 3,
37 Acacia = 4,
38 Darkoak = 5,
39 Iron = 6,
40 Crimson = 7,
41 BlueNethershroom = 8,
42 Mangrove = 9,
43 Bamboo = 10,
44 Cherry = 11,
45 Copper = 12,
46 ExposedCopper = 13,
47 WeatheredCopper = 14,
48 OxidizedCopper = 15,
49 WaxedCopper = 16,
50 WaxedExposedCopper = 17,
51 WaxedWeatheredCopper = 18,
52 WaxedOxidizedCopper = 19,
53 PaleOak = 20,
54 Count = 21,
55 };
56
57public:
58 // member variables
59 // NOLINTBEGIN
60 ::ll::TypedStorage<4, 4, ::DoorBlock::DoorType> mType;
61 // NOLINTEND
62
63public:
64 // prevent constructor by default
65 DoorBlock();
66
67public:
68 // virtual functions
69 // NOLINTBEGIN
70 virtual int getVariant(::Block const& block) const /*override*/;
71
72 virtual ::Block const* getNextBlockPermutation(::Block const& currentBlock) const /*override*/;
73
74 virtual ::AABB const& getVisualShapeInWorld(
75 ::Block const&,
76 ::IConstBlockSource const& region,
77 ::BlockPos const& pos,
78 ::AABB& bufferAABB
79 ) const /*override*/;
80
81 virtual ::AABB getCollisionShape(
82 ::Block const& block,
83 ::IConstBlockSource const& region,
84 ::BlockPos const& pos,
86 ) const /*override*/;
87
88 virtual ::AABB const& getOutline(
89 ::Block const& block,
90 ::IConstBlockSource const& region,
91 ::BlockPos const& pos,
92 ::AABB& bufferValue
93 ) const /*override*/;
94
95 virtual bool
96 getLiquidClipVolume(::Block const& block, ::BlockSource& region, ::BlockPos const& pos, ::AABB& includeBox) const
97 /*override*/;
98
99 virtual void neighborChanged(::BlockSource& region, ::BlockPos const& pos, ::BlockPos const& neighborPos) const
100 /*override*/;
101
102 virtual ::ItemInstance asItemInstance(::Block const& block, ::BlockActor const*) const /*override*/;
103
104 virtual bool getSecondPart(::IConstBlockSource const& region, ::BlockPos const& pos, ::BlockPos& out) const
105 /*override*/;
106
107 virtual bool canSurvive(::BlockSource& region, ::BlockPos const& pos) const /*override*/;
108
109 virtual ::Block const* playerWillDestroy(::Player& player, ::BlockPos const& pos, ::Block const& block) const
110 /*override*/;
111
112 virtual bool mayPlace(::BlockSource& region, ::BlockPos const& pos) const /*override*/;
113
114 virtual bool isInteractiveBlock() const /*override*/;
115
116 virtual bool checkIsPathable(::Actor& entity, ::BlockPos const& lastPathPos, ::BlockPos const& pathPos) const
117 /*override*/;
118
119 virtual void onFillBlock(::BlockSource& region, ::BlockPos const& pos, ::Block const& block) const /*override*/;
120
121 virtual bool canFillAtPos(::BlockSource& region, ::BlockPos const& pos, ::Block const& fillBlock) const
122 /*override*/;
123
124 virtual bool isDoorBlock() const /*override*/;
125
126 virtual void _useDoor(::BlockEvents::BlockPlayerInteractEvent& eventData) const;
127
128 virtual void _onHitByActivatingAttack(::BlockSource& region, ::BlockPos const& pos, ::Actor*) const /*override*/;
129
130 virtual ~DoorBlock() /*override*/;
131 // NOLINTEND
132
133public:
134 // member functions
135 // NOLINTBEGIN
136 MCAPI DoorBlock(::std::string const& nameId, int id, ::Material const& material, ::DoorBlock::DoorType type);
137
138 MCAPI bool _hasSupport(::BlockPos const& pos, uchar face, ::BlockSupportType, ::BlockSource& region) const;
139
140 MCAPI void _onRedstoneUpdate(::BlockEvents::BlockRedstoneUpdateEvent& blockEvent) const;
141
142 MCAPI ::Direction::Type getBlockedDirection(::IConstBlockSource const& region, ::BlockPos const& pos) const;
143
144 MCAPI bool isToggled(::IConstBlockSource const& region, ::BlockPos const& pos) const;
145
146 MCAPI void setToggled(::BlockSource& region, ::BlockPos const& pos, ::Actor* sourceActor, bool toggled) const;
147
148#ifdef LL_PLAT_C
149 MCAPI bool shouldFlipTexture(::BlockSource& region, ::BlockPos const& pos, uchar face) const;
150#endif
151
152 MCFOLD void tick(::BlockEvents::BlockQueuedTickEvent& eventData) const;
153
154 MCFOLD void use(::BlockEvents::BlockPlayerInteractEvent& eventData) const;
155 // NOLINTEND
156
157public:
158 // static functions
159 // NOLINTBEGIN
160 MCAPI static bool
161 _isDoorToggled(::IConstBlockSource const& region, ::BlockType const& blockType, ::BlockPos const& pos);
162
163 MCAPI static void _onSetupRedstoneComponent(::BlockSource& region, ::BlockPos const& pos);
164
165 MCAPI static void getDoorBlocks(
166 ::IConstBlockSource const& region,
167 ::BlockType const& expectedDoorBlockType,
168 ::BlockPos const& pos,
169 ::Block const*& outLowerBlock,
170 ::Block const*& outUpperBlock
171 );
172 // NOLINTEND
173
174public:
175 // constructor thunks
176 // NOLINTBEGIN
177 MCAPI void* $ctor(::std::string const& nameId, int id, ::Material const& material, ::DoorBlock::DoorType type);
178 // NOLINTEND
179
180public:
181 // destructor thunk
182 // NOLINTBEGIN
183 MCFOLD void $dtor();
184 // NOLINTEND
185
186public:
187 // virtual function thunks
188 // NOLINTBEGIN
189 MCAPI int $getVariant(::Block const& block) const;
190
191 MCFOLD ::Block const* $getNextBlockPermutation(::Block const& currentBlock) const;
192
193 MCAPI ::AABB const& $getVisualShapeInWorld(
194 ::Block const&,
195 ::IConstBlockSource const& region,
196 ::BlockPos const& pos,
197 ::AABB& bufferAABB
198 ) const;
199
200 MCAPI ::AABB $getCollisionShape(
201 ::Block const& block,
202 ::IConstBlockSource const& region,
203 ::BlockPos const& pos,
205 ) const;
206
207 MCFOLD ::AABB const& $getOutline(
208 ::Block const& block,
209 ::IConstBlockSource const& region,
210 ::BlockPos const& pos,
211 ::AABB& bufferValue
212 ) const;
213
214 MCAPI bool
215 $getLiquidClipVolume(::Block const& block, ::BlockSource& region, ::BlockPos const& pos, ::AABB& includeBox) const;
216
217 MCFOLD void $neighborChanged(::BlockSource& region, ::BlockPos const& pos, ::BlockPos const& neighborPos) const;
218
219 MCAPI ::ItemInstance $asItemInstance(::Block const& block, ::BlockActor const*) const;
220
221 MCFOLD bool $getSecondPart(::IConstBlockSource const& region, ::BlockPos const& pos, ::BlockPos& out) const;
222
223 MCAPI bool $canSurvive(::BlockSource& region, ::BlockPos const& pos) const;
224
225 MCAPI ::Block const* $playerWillDestroy(::Player& player, ::BlockPos const& pos, ::Block const& block) const;
226
227 MCAPI bool $mayPlace(::BlockSource& region, ::BlockPos const& pos) const;
228
229 MCFOLD bool $isInteractiveBlock() const;
230
231 MCAPI bool $checkIsPathable(::Actor& entity, ::BlockPos const& lastPathPos, ::BlockPos const& pathPos) const;
232
233 MCAPI void $onFillBlock(::BlockSource& region, ::BlockPos const& pos, ::Block const& block) const;
234
235 MCAPI bool $canFillAtPos(::BlockSource& region, ::BlockPos const& pos, ::Block const& fillBlock) const;
236
237 MCFOLD bool $isDoorBlock() const;
238
239 MCAPI void $_useDoor(::BlockEvents::BlockPlayerInteractEvent& eventData) const;
240
241 MCAPI void $_onHitByActivatingAttack(::BlockSource& region, ::BlockPos const& pos, ::Actor*) const;
242
243
244 // NOLINTEND
245
246public:
247 // vftables
248 // NOLINTBEGIN
249 MCAPI static void** $vftable();
250 // NOLINTEND
251};
Definition AABB.h:18
Definition Actor.h:106
Definition BlockActor.h:30
Definition BlockPlayerInteractEvent.h:17
Definition BlockQueuedTickEvent.h:16
Definition BlockRedstoneUpdateEvent.h:15
Definition BlockPos.h:19
Definition BlockSource.h:71
Definition Block.h:43
Definition GetCollisionShapeInterface.h:13
Definition IConstBlockSource.h:25
Definition ItemInstance.h:15
Definition Material.h:8
Definition Player.h:129
Definition optional_ref.h:10