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