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