LeviLamina
Loading...
Searching...
No Matches
BlockActor.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/container/EnumSet.h"
7#include "mc/safety/RedactableString.h"
8#include "mc/world/actor/ActorTerrainInterlockData.h"
9#include "mc/world/level/BlockPos.h"
10#include "mc/world/level/block/actor/BlockActorRendererId.h"
11#include "mc/world/level/block/actor/BlockActorType.h"
12#include "mc/world/phys/AABB.h"
13
14// auto generated forward declare list
15// clang-format off
16class Actor;
17class Block;
18class BlockActorDataPacket;
19class BlockSource;
20class CompoundTag;
21class Container;
22class DataLoadHelper;
24class ILevel;
25class LevelChunk;
27class Player;
28class SaveContext;
29class Vec3;
30// clang-format on
31
33public:
34 // BlockActor inner types define
35 enum class Property : uchar {
36 Changed = 0,
37 Movable = 1,
38 ClientSideOnly = 2,
39 SaveCustomName = 3,
40 CanRenderCustomName = 4,
41 Count = 5,
42 };
43
45
46 using MapIdType = ::std::unordered_map<::std::string, ::BlockActorType>;
47
48 using MapTypeId = ::std::unordered_map<::BlockActorType, ::std::string>;
49
50public:
51 LLAPI void refresh(optional_ref<class BlockSource> blockSource = std::nullopt);
52
53 LLNDAPI static std::shared_ptr<BlockActor> create(class CompoundTag const& nbt);
54
55 LLNDAPI static std::shared_ptr<BlockActor> create(class CompoundTag const& nbt, class BlockPos const& pos);
56
57public:
58 // member variables
59 // NOLINTBEGIN
60 ::ll::TypedStorage<4, 4, int> mTickCount;
61 ::ll::TypedStorage<4, 4, int> mRepairCost;
62 ::ll::TypedStorage<4, 12, ::BlockPos> mPosition;
63 ::ll::TypedStorage<4, 24, ::AABB> mBB;
64 ::ll::TypedStorage<1, 1, ::BlockActorRendererId> mRendererId;
65 ::ll::TypedStorage<1, 1, ::BlockActorType const> mType;
66 ::ll::TypedStorage<1, 1, ::Bedrock::EnumSet<::BlockActor::Property, 5>> mProperties;
67 ::ll::TypedStorage<8, 72, ::Bedrock::Safety::RedactableString> mCustomName;
68 ::ll::TypedStorage<8, 24, ::ActorTerrainInterlockData> mTerrainInterlockData;
69 // NOLINTEND
70
71public:
72 // prevent constructor by default
73 BlockActor();
74
75public:
76 // virtual functions
77 // NOLINTBEGIN
78 // vIndex: 0
79 virtual ~BlockActor();
80
81 // vIndex: 1
82 virtual void load(::ILevel&, ::CompoundTag const& tag, ::DataLoadHelper&);
83
84 // vIndex: 2
85 virtual bool save(::CompoundTag& tag, ::SaveContext const&) const;
86
87 // vIndex: 3
88 virtual bool saveItemInstanceData(::CompoundTag& tag, ::SaveContext const& saveContext) const;
89
90 // vIndex: 4
91 virtual void saveBlockData(::CompoundTag&, ::BlockSource&) const;
92
93 // vIndex: 5
94 virtual void loadBlockData(::CompoundTag const&, ::BlockSource&, ::DataLoadHelper&);
95
96 // vIndex: 6
97 virtual void onCustomTagLoadDone(::BlockSource&);
98
99 // vIndex: 7
100 virtual bool isPermanentlyRendered() const;
101
102 // vIndex: 8
103 virtual bool isWithinRenderDistance(::Vec3 const& cameraPosition) const;
104
105 // vIndex: 9
106 virtual void tick(::BlockSource& region);
107
108 // vIndex: 10
109 virtual void onChanged(::BlockSource&);
110
111 // vIndex: 11
112 virtual void onPlace(::BlockSource&);
113
114 // vIndex: 12
115 virtual void onMove();
116
117 // vIndex: 13
118 virtual void onRemoved(::BlockSource&);
119
120 // vIndex: 14
121 virtual bool isPreserved(::BlockSource&) const;
122
123 // vIndex: 15
124 virtual bool shouldPreserve(::BlockSource&);
125
126 // vIndex: 16
127 virtual void triggerEvent(int, int);
128
129 // vIndex: 17
130 virtual void executeEvent(::BlockSource&, ::BlockPos const&, ::Block const&, ::std::string const&, ::Actor&);
131
132 // vIndex: 18
133 virtual void onNeighborChanged(::BlockSource&, ::BlockPos const&);
134
135 // vIndex: 19
136 virtual float getShadowRadius(::BlockSource&) const;
137
138 // vIndex: 20
139 virtual bool hasAlphaLayer() const;
140
141 // vIndex: 21
142 virtual ::BlockActor* getCrackEntity(::BlockSource&, ::BlockPos const&);
143
144 // vIndex: 22
145 virtual ::AABB getCollisionShape(::IConstBlockSource const&) const;
146
147 // vIndex: 23
148 virtual void getDebugText(
149 ::std::vector<::std::string>& outputInfo,
150 ::BlockPos const& debugPos,
151 ::BlockSource const* region
152 ) const;
153
154 // vIndex: 24
155 virtual ::Bedrock::Safety::RedactableString const& getCustomName() const;
156
157 // vIndex: 25
158 virtual ::std::string getName() const;
159
160 // vIndex: 26
161 virtual void setCustomName(::Bedrock::Safety::RedactableString const& name);
162
163 // vIndex: 27
164 virtual ::std::string getImmersiveReaderText(::BlockSource&);
165
166 // vIndex: 29
167 virtual ::PistonBlockActor* getOwningPiston(::BlockSource&);
168
169 // vIndex: 28
170 virtual ::PistonBlockActor const* getOwningPiston(::BlockSource&) const;
171
172 // vIndex: 31
173 virtual ::Container* getContainer();
174
175 // vIndex: 30
176 virtual ::Container const* getContainer() const;
177
178 // vIndex: 32
179 virtual void eraseLootTable();
180
181 // vIndex: 33
182 virtual void onChunkLoaded(::LevelChunk&);
183
184 // vIndex: 34
185 virtual void onChunkUnloaded(::LevelChunk&);
186
187 // vIndex: 35
188 virtual void onSubChunkLoaded(::LevelChunk&, short, bool);
189
190 // vIndex: 36
191 virtual ::std::vector<::std::string> getUgcStrings(::CompoundTag const&) const;
192
193 // vIndex: 37
194 virtual ::std::vector<::std::string> getFilteredUgcStrings(::CompoundTag const&) const;
195
196 // vIndex: 38
197 virtual void setUgcStrings(::CompoundTag&, ::std::vector<::std::string> const&) const;
198
199 // vIndex: 39
200 virtual void setFilteredUgcStrings(::CompoundTag&, ::std::vector<::std::string> const&) const;
201
202 // vIndex: 40
203 virtual void fixupOnLoad(::LevelChunk&);
204
205 // vIndex: 41
206 virtual ::std::unique_ptr<::BlockActorDataPacket> _getUpdatePacket(::BlockSource&);
207
208 // vIndex: 42
209 virtual void _onUpdatePacket(::CompoundTag const&, ::BlockSource&);
210
211 // vIndex: 43
212 virtual bool _playerCanUpdate(::Player const&) const;
213 // NOLINTEND
214
215public:
216 // member functions
217 // NOLINTBEGIN
218 MCAPI BlockActor(::BlockActorType type, ::BlockPos const& pos, ::BlockActorRendererId rendererId);
219
220 MCAPI bool onUpdatePacket(::CompoundTag const& data, ::BlockSource& region, ::Player const* fromPlayer);
221 // NOLINTEND
222
223public:
224 // static functions
225 // NOLINTBEGIN
226 MCAPI static ::std::unordered_map<::BlockActorType, ::std::string> const& _getClassIdMap();
227
228 MCAPI static ::std::shared_ptr<::BlockActor>
229 loadStatic(::ILevel& level, ::CompoundTag const& tag, ::DataLoadHelper& dataLoadHelper);
230 // NOLINTEND
231
232public:
233 // constructor thunks
234 // NOLINTBEGIN
235 MCAPI void* $ctor(::BlockActorType type, ::BlockPos const& pos, ::BlockActorRendererId rendererId);
236 // NOLINTEND
237
238public:
239 // destructor thunk
240 // NOLINTBEGIN
241 MCAPI void $dtor();
242 // NOLINTEND
243
244public:
245 // virtual function thunks
246 // NOLINTBEGIN
247 MCAPI void $load(::ILevel&, ::CompoundTag const& tag, ::DataLoadHelper&);
248
249 MCAPI bool $save(::CompoundTag& tag, ::SaveContext const&) const;
250
251 MCAPI bool $saveItemInstanceData(::CompoundTag& tag, ::SaveContext const& saveContext) const;
252
253 MCFOLD void $saveBlockData(::CompoundTag&, ::BlockSource&) const;
254
255 MCFOLD void $loadBlockData(::CompoundTag const&, ::BlockSource&, ::DataLoadHelper&);
256
257 MCFOLD void $onCustomTagLoadDone(::BlockSource&);
258
259 MCFOLD bool $isPermanentlyRendered() const;
260
261 MCAPI bool $isWithinRenderDistance(::Vec3 const& cameraPosition) const;
262
263 MCAPI void $tick(::BlockSource& region);
264
265 MCFOLD void $onChanged(::BlockSource&);
266
267 MCFOLD void $onPlace(::BlockSource&);
268
269 MCFOLD void $onMove();
270
271 MCFOLD void $onRemoved(::BlockSource&);
272
273 MCFOLD bool $isPreserved(::BlockSource&) const;
274
275 MCFOLD bool $shouldPreserve(::BlockSource&);
276
277 MCFOLD void $triggerEvent(int, int);
278
279 MCFOLD void $executeEvent(::BlockSource&, ::BlockPos const&, ::Block const&, ::std::string const&, ::Actor&);
280
281 MCFOLD void $onNeighborChanged(::BlockSource&, ::BlockPos const&);
282
283 MCFOLD float $getShadowRadius(::BlockSource&) const;
284
285 MCFOLD bool $hasAlphaLayer() const;
286
287 MCFOLD ::BlockActor* $getCrackEntity(::BlockSource&, ::BlockPos const&);
288
289 MCAPI ::AABB $getCollisionShape(::IConstBlockSource const&) const;
290
291 MCAPI void $getDebugText(
292 ::std::vector<::std::string>& outputInfo,
293 ::BlockPos const& debugPos,
294 ::BlockSource const* region
295 ) const;
296
297 MCFOLD ::Bedrock::Safety::RedactableString const& $getCustomName() const;
298
299 MCFOLD ::std::string $getName() const;
300
301 MCAPI void $setCustomName(::Bedrock::Safety::RedactableString const& name);
302
303 MCFOLD ::std::string $getImmersiveReaderText(::BlockSource&);
304
305 MCFOLD ::PistonBlockActor* $getOwningPiston(::BlockSource&);
306
307 MCFOLD ::PistonBlockActor const* $getOwningPiston(::BlockSource&) const;
308
309 MCFOLD ::Container* $getContainer();
310
311 MCFOLD ::Container const* $getContainer() const;
312
313 MCFOLD void $eraseLootTable();
314
315 MCFOLD void $onChunkLoaded(::LevelChunk&);
316
317 MCFOLD void $onChunkUnloaded(::LevelChunk&);
318
319 MCFOLD void $onSubChunkLoaded(::LevelChunk&, short, bool);
320
321 MCFOLD ::std::vector<::std::string> $getUgcStrings(::CompoundTag const&) const;
322
323 MCFOLD ::std::vector<::std::string> $getFilteredUgcStrings(::CompoundTag const&) const;
324
325 MCFOLD void $setUgcStrings(::CompoundTag&, ::std::vector<::std::string> const&) const;
326
327 MCFOLD void $setFilteredUgcStrings(::CompoundTag&, ::std::vector<::std::string> const&) const;
328
329 MCFOLD void $fixupOnLoad(::LevelChunk&);
330
331 MCFOLD ::std::unique_ptr<::BlockActorDataPacket> $_getUpdatePacket(::BlockSource&);
332
333 MCFOLD void $_onUpdatePacket(::CompoundTag const&, ::BlockSource&);
334
335 MCFOLD bool $_playerCanUpdate(::Player const&) const;
336 // NOLINTEND
337
338public:
339 // vftables
340 // NOLINTBEGIN
341 MCAPI static void** $vftable();
342 // NOLINTEND
343};
Definition Actor.h:102
Definition EnumSet.h:8
Definition RedactableString.h:10
Definition BlockActor.h:32
Definition BlockPos.h:17
Definition BlockSource.h:66
Definition Block.h:37
Definition CompoundTag.h:13
Definition Container.h:31
Definition DataLoadHelper.h:20
Definition IConstBlockSource.h:24
Definition ILevel.h:207
Definition LevelChunk.h:77
Definition PistonBlockActor.h:26
Definition Player.h:123
Definition SaveContext.h:5
Definition Vec3.h:10
Definition optional_ref.h:10