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