LeviLamina
Loading...
Searching...
No Matches
SignBlock.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/block/ActorBlockBase.h"
8#include "mc/world/level/block/BlockType.h"
9#include "mc/world/level/block/actor/SignTextSide.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 Item;
22class ItemInstance;
23class ItemStack;
24class Player;
25class SignBlockActor;
26namespace BlockEvents { class BlockPlayerInteractEvent; }
27namespace BlockEvents { class BlockQueuedTickEvent; }
28namespace mce { class Color; }
29// clang-format on
30
31class SignBlock : public ::ActorBlock {
32public:
33 // SignBlock inner types declare
34 // clang-format off
36 // clang-format on
37
38 // SignBlock inner types define
39 enum class SignType : int {
40 Oak = 0,
41 Spruce = 1,
42 Birch = 2,
43 Jungle = 3,
44 Acacia = 4,
45 DarkOak = 5,
46 RedBigNetherShroom = 6,
47 BlueBigNetherShroom = 7,
48 Mangrove = 8,
49 Bamboo = 9,
50 Cherry = 10,
51 PaleOak = 11,
52 };
53
55 public:
56 // SignInteractionResult inner types define
57 enum class Result : int {
58 NoInteraction = 0,
59 FailWaxedSign = 1,
60 UseDye = 2,
61 UseGlowInkSac = 3,
62 UseInkSac = 4,
63 UseHoneyComb = 5,
64 OpenForEditing = 6,
65 };
66
67 public:
68 // member variables
69 // NOLINTBEGIN
70 ::ll::TypedStorage<4, 4, ::SignBlock::SignInteractionResult::Result> mResult;
71 // NOLINTEND
72
73 public:
74 // member functions
75 // NOLINTBEGIN
76#ifdef LL_PLAT_C
77 MCAPI ::std::optional<::std::string> getButtonTooltip() const;
78#endif
79 // NOLINTEND
80 };
81
82public:
83 // member variables
84 // NOLINTBEGIN
85 ::ll::TypedStorage<4, 4, ::SignBlock::SignType> mSignType;
86 ::ll::TypedStorage<1, 1, bool> mOnGround;
87 // NOLINTEND
88
89public:
90 // prevent constructor by default
91 SignBlock();
92
93public:
94 // virtual functions
95 // NOLINTBEGIN
96 virtual ::AABB const& getVisualShape(::Block const& block, ::AABB& bufferAABB) const /*override*/;
97
98 virtual ::AABB getCollisionShape(
99 ::Block const&,
100 ::IConstBlockSource const&,
101 ::BlockPos const&,
103 ) const /*override*/;
104
105 virtual bool checkIsPathable(::Actor&, ::BlockPos const&, ::BlockPos const&) const /*override*/;
106
107 virtual ::ItemInstance asItemInstance(::Block const&, ::BlockActor const*) const /*override*/;
108
109 virtual bool mayPlace(::BlockSource& region, ::BlockPos const& pos, uchar face) const /*override*/;
110
111 virtual void neighborChanged(::BlockSource& region, ::BlockPos const& pos, ::BlockPos const& neighborPos) const
112 /*override*/;
113
114 virtual bool canSurvive(::BlockSource& region, ::BlockPos const& pos) const /*override*/;
115
116 virtual bool isInteractiveBlock() const /*override*/;
117
118 virtual float getYRotationInDegrees(::Block const& block) const;
119
120 virtual bool _canSurvive(::BlockSource& region, ::BlockPos const& pos, uchar face) const;
121
122 virtual ::ItemInstance _getItemInstance() const;
123 // NOLINTEND
124
125public:
126 // member functions
127 // NOLINTBEGIN
128 MCAPI SignBlock(::std::string const& nameId, int id, bool onGround, ::SignBlock::SignType signType);
129
130#ifdef LL_PLAT_C
131 MCFOLD ::SignBlock::SignType getSignType() const;
132#endif
133
134 MCFOLD void tick(::BlockEvents::BlockQueuedTickEvent& eventData) const;
135
136 MCAPI void use(::BlockEvents::BlockPlayerInteractEvent& eventData) const;
137 // NOLINTEND
138
139public:
140 // static functions
141 // NOLINTBEGIN
142 MCAPI static bool
143 _canUseDye(::SignBlockActor& blockActor, ::SignTextSide side, ::mce::Color const& dyeColor, ::Player& player);
144
145 MCAPI static bool _canUseHoneyComb(::SignBlockActor& blockActor, ::Player& player);
146
147 MCAPI static bool _canUseInkSac(::SignBlockActor& blockActor, ::SignTextSide side, ::Player& player);
148
149 MCAPI static ::SignBlock::SignInteractionResult _getInteractResult(
150 ::SignBlockActor& blockActor,
151 ::SignTextSide side,
152 ::ItemStack& item,
153 ::Player& player,
154 ::BlockPos const& pos,
155 uchar face
156 );
157
158 MCAPI static void _getShape(int facing, ::AABB& bufferValue);
159
160 MCAPI static void _useDye(
161 ::SignBlockActor& blockActor,
162 ::SignTextSide side,
163 ::ItemStack& dyeStack,
164 ::BlockPos const& pos,
165 ::Player& player
166 );
167
168 MCAPI static void
169 _useHoneyComb(::SignBlockActor& blockActor, ::ItemStack& honeyCombStack, ::BlockPos const& pos, ::Player& player);
170
171#ifdef LL_PLAT_C
172 MCAPI static ::SignBlock::SignInteractionResult
173 getInteractResult(::Player& player, ::BlockPos const& pos, uchar face);
174#endif
175
176 MCAPI static ::mce::Color getSignTextColorFromDyeItem(::Item const& dyeItem);
177 // NOLINTEND
178
179public:
180 // constructor thunks
181 // NOLINTBEGIN
182 MCAPI void* $ctor(::std::string const& nameId, int id, bool onGround, ::SignBlock::SignType signType);
183 // NOLINTEND
184
185public:
186 // virtual function thunks
187 // NOLINTBEGIN
188 MCAPI ::AABB const& $getVisualShape(::Block const& block, ::AABB& bufferAABB) const;
189
190 MCFOLD ::AABB $getCollisionShape(
191 ::Block const&,
192 ::IConstBlockSource const&,
193 ::BlockPos const&,
195 ) const;
196
197 MCFOLD bool $checkIsPathable(::Actor&, ::BlockPos const&, ::BlockPos const&) const;
198
199 MCAPI ::ItemInstance $asItemInstance(::Block const&, ::BlockActor const*) const;
200
201 MCAPI bool $mayPlace(::BlockSource& region, ::BlockPos const& pos, uchar face) const;
202
203 MCAPI void $neighborChanged(::BlockSource& region, ::BlockPos const& pos, ::BlockPos const& neighborPos) const;
204
205 MCAPI bool $canSurvive(::BlockSource& region, ::BlockPos const& pos) const;
206
207 MCFOLD bool $isInteractiveBlock() const;
208
209 MCAPI float $getYRotationInDegrees(::Block const& block) const;
210
211 MCAPI bool $_canSurvive(::BlockSource& region, ::BlockPos const& pos, uchar face) const;
212
213 MCAPI ::ItemInstance $_getItemInstance() const;
214
215
216 // NOLINTEND
217
218public:
219 // vftables
220 // NOLINTBEGIN
221 MCAPI static void** $vftable();
222 // NOLINTEND
223};
Definition AABB.h:18
Definition Actor.h:125
Definition BlockActor.h:30
Definition BlockPlayerInteractEvent.h:20
Definition BlockQueuedTickEvent.h:18
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 ItemStack.h:35
Definition Item.h:71
Definition Player.h:137
Definition SignBlockActor.h:32
Definition Color.h:13
Definition optional_ref.h:10
STL namespace.
Definition SignBlock.h:54