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