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