LeviLamina
Loading...
Searching...
No Matches
ChestBlockActor.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/shared_types/legacy/LevelSoundEvent.h"
7#include "mc/legacy/ActorUniqueID.h"
8#include "mc/world/level/BlockPos.h"
9#include "mc/world/level/block/ChestType.h"
10#include "mc/world/level/block/actor/BlockActorRendererId.h"
11#include "mc/world/level/block/actor/BlockActorType.h"
12#include "mc/world/level/block/actor/RandomizableBlockActorFillingContainer.h"
13
14// auto generated forward declare list
15// clang-format off
16class AABB;
17class Actor;
18class BlockActor;
19class BlockActorDataPacket;
20class BlockSource;
21class ChestBlock;
22class CompoundTag;
23class Container;
25class DataLoadHelper;
26class ILevel;
27class ItemStack;
28class Player;
29class SaveContext;
30// clang-format on
31
33public:
34 // ChestBlockActor inner types declare
35 // clang-format off
36 class ChestCloser;
37 // clang-format on
38
39 // ChestBlockActor inner types define
41 public:
42 // member variables
43 // NOLINTBEGIN
44 ::ll::TypedStorage<8, 8, ::ChestBlockActor&> mChest;
45 ::ll::TypedStorage<1, 1, bool> mIsUsed;
46 ::ll::TypedStorage<8, 8, ::ActorUniqueID> mActorId;
47 // NOLINTEND
48
49 public:
50 // prevent constructor by default
51 ChestCloser& operator=(ChestCloser const&);
54 };
55
56public:
57 // member variables
58 // NOLINTBEGIN
59 ::ll::TypedStorage<4, 4, float> mSpeed;
60 ::ll::TypedStorage<1, 1, bool> mIsGlobalChest;
61 ::ll::TypedStorage<1, 1, bool> mUsesBlockTypeDetection;
62 ::ll::TypedStorage<4, 4, float> mObstructionHeight;
63 bool mPairLead : 1;
64 ::ll::TypedStorage<4, 4, float> mOpenness;
65 ::ll::TypedStorage<4, 4, float> mOldOpenness;
66 ::ll::TypedStorage<1, 1, bool> mIsOpen;
67 ::ll::TypedStorage<4, 4, int> mTickInterval;
68 bool mPairingChanged : 1;
69 bool mAlongX : 1;
70 bool mDeferredPairLoad : 1;
71 bool mConverted : 1;
72 ::ll::TypedStorage<4, 4, int> mDeferredPairX;
73 ::ll::TypedStorage<4, 4, int> mDeferredPairZ;
74 ::ll::TypedStorage<8, 8, ::ChestBlockActor*> mLargeChestPaired;
75 ::ll::TypedStorage<4, 12, ::BlockPos> mLargeChestPairedPosition;
76 ::ll::TypedStorage<1, 2, ::std::optional<::ChestType>> mChestType;
77 ::ll::TypedStorage<1, 1, bool> mIsFindable;
78 ::ll::TypedStorage<8, 64, ::std::unordered_set<::ActorUniqueID>> mOpenedByIds;
79 ::ll::TypedStorage<4, 4, int> mUpdateFlags;
80 ::ll::TypedStorage<8, 24, ::std::vector<::std::shared_ptr<::ChestBlockActor::ChestCloser>>> mChestClosers;
81 // NOLINTEND
82
83public:
84 // prevent constructor by default
86
87public:
88 // virtual functions
89 // NOLINTBEGIN
90 // vIndex: 0
91 virtual ~ChestBlockActor() /*override*/;
92
93 // vIndex: 20
94 virtual int getContainerSize() const /*override*/;
95
96 // vIndex: 21
97 virtual int getMaxStackSize() const /*override*/;
98
99 // vIndex: 25
100 virtual ::std::string getName() const /*override*/;
101
102 // vIndex: 7
103 virtual ::ItemStack const& getItem(int slot) const /*override*/;
104
105 // vIndex: 12
106 virtual void setItem(int slot, ::ItemStack const& item) /*override*/;
107
108 // vIndex: 13
109 virtual void setItemWithForceBalance(int slot, ::ItemStack const& item, bool forceBalanced) /*override*/;
110
111 // vIndex: 2
112 virtual void serverInitItemStackIds(
113 int containerSlot,
114 int count,
115 ::std::function<void(int, ::ItemStack const&)> onNetIdChanged
116 ) /*override*/;
117
118 // vIndex: 44
119 virtual void loadItems(::CompoundTag const& base, ::ILevel& level);
120
121 // vIndex: 1
122 virtual void load(::ILevel& level, ::CompoundTag const& base, ::DataLoadHelper& dataLoadHelper) /*override*/;
123
124 // vIndex: 45
125 virtual bool saveItems(::CompoundTag& base, ::SaveContext const& saveContext) const;
126
127 // vIndex: 2
128 virtual bool save(::CompoundTag& tag, ::SaveContext const& saveContext) const /*override*/;
129
130 // vIndex: 3
131 virtual bool saveItemInstanceData(::CompoundTag& tag, ::SaveContext const& saveContext) const /*override*/;
132
133 // vIndex: 9
134 virtual void tick(::BlockSource& region) /*override*/;
135
136 // vIndex: 16
137 virtual void triggerEvent(int b0, int b1) /*override*/;
138
139 // vIndex: 22
140 virtual void startOpen(::Actor& actor) /*override*/;
141
142 // vIndex: 13
143 virtual void onRemoved(::BlockSource& region) /*override*/;
144
145 // vIndex: 23
146 virtual void stopOpen(::Actor& actor) /*override*/;
147
148 // vIndex: 10
149 virtual void onChanged(::BlockSource& region) /*override*/;
150
151 // vIndex: 18
152 virtual void onNeighborChanged(::BlockSource& region, ::BlockPos const& position) /*override*/;
153
154 // vIndex: 21
155 virtual ::BlockActor* getCrackEntity(::BlockSource& region, ::BlockPos const& pos) /*override*/;
156
157 // vIndex: 49
158 virtual int clearInventory(int resizeTo) /*override*/;
159
160 // vIndex: 31
161 virtual ::Container* getContainer() /*override*/;
162
163 // vIndex: 30
164 virtual ::Container const* getContainer() const /*override*/;
165
166 // vIndex: 12
167 virtual void onMove() /*override*/;
168
169 // vIndex: 11
170 virtual void onPlace(::BlockSource& region) /*override*/;
171
172 // vIndex: 46
173 virtual void openBy(::Player& p);
174
175 // vIndex: 34
176 virtual void setContainerChanged(int slot) /*override*/;
177
178 // vIndex: 32
179 virtual bool canPushInItem(int, int, ::ItemStack const&) const /*override*/;
180
181 // vIndex: 33
182 virtual bool canPullOutItem(int, int, ::ItemStack const&) const /*override*/;
183
184 // vIndex: 23
185 virtual void getDebugText(
186 ::std::vector<::std::string>& outputInfo,
187 ::BlockPos const& debugPos,
188 ::BlockSource const* region
189 ) const /*override*/;
190
191 // vIndex: 3
192 virtual void addContentChangeListener(::ContainerContentChangeListener* listener) /*override*/;
193
194 // vIndex: 4
195 virtual void removeContentChangeListener(::ContainerContentChangeListener* listener) /*override*/;
196
197 // vIndex: 41
198 virtual void initializeContainerContents(::BlockSource& region) /*override*/;
199
200 // vIndex: 41
201 virtual ::std::unique_ptr<::BlockActorDataPacket> _getUpdatePacket(::BlockSource& region) /*override*/;
202
203 // vIndex: 42
204 virtual void _onUpdatePacket(::CompoundTag const& data, ::BlockSource& region) /*override*/;
205
206 // vIndex: 47
207 virtual bool _canOpenThis(::BlockSource& region) const;
208
209 // vIndex: 48
210 virtual ::AABB getObstructionAABB() const;
211
212 // vIndex: 49
213 virtual bool _detectEntityObstruction(::BlockSource& region) const;
214
215 // vIndex: 50
216 virtual ::SharedTypes::Legacy::LevelSoundEvent getOpenSound() const;
217
218 // vIndex: 51
219 virtual ::SharedTypes::Legacy::LevelSoundEvent getCloseSound() const;
220 // NOLINTEND
221
222public:
223 // member functions
224 // NOLINTBEGIN
225 MCAPI ChestBlockActor(
226 ::BlockActorType type,
227 ::BlockActorRendererId renderId,
228 ::std::optional<::ChestType> chestType,
229 ::BlockPos const& pos
230 );
231
232 MCAPI void _closeChest(::BlockSource& region, ::Actor* actor);
233
234 MCAPI bool _detectBlockObstruction(::BlockSource& region) const;
235
236 MCAPI void _pairWith(::ChestBlockActor* chest, ::BlockSource& region, bool isLead);
237
238 MCAPI bool _saveClientSideState(::CompoundTag& tag, ::SaveContext const& saveContext) const;
239
240 MCAPI void _tryToPairWith(::BlockSource& region, ::BlockPos const& position);
241
242 MCAPI void _unpair();
243
244 MCAPI void _validatePairedChest(::BlockSource& region);
245
246 MCAPI bool canOpen(::BlockSource& region) const;
247
248 MCAPI bool canPairWith(::BlockActor* entity, ::BlockSource& region);
249
250 MCAPI void forceCloseChest(::BlockSource& region);
251
252 MCAPI ::std::weak_ptr<::ChestBlockActor::ChestCloser> getChestCloser(::Actor& closingActor);
253
254 MCAPI void pairWithLeadChest(::ChestBlockActor* leadChest, ::BlockSource& region);
255
256 MCAPI void playCloseSound(::BlockSource& region);
257
258 MCAPI void playOpenSound(::BlockSource& region);
259
260 MCAPI ::ChestBlock const* tryGetChestBlock(::BlockSource const& region) const;
261
262 MCAPI void unpair(::BlockSource& region);
263 // NOLINTEND
264
265public:
266 // constructor thunks
267 // NOLINTBEGIN
268 MCAPI void* $ctor(
269 ::BlockActorType type,
270 ::BlockActorRendererId renderId,
271 ::std::optional<::ChestType> chestType,
272 ::BlockPos const& pos
273 );
274 // NOLINTEND
275
276public:
277 // destructor thunk
278 // NOLINTBEGIN
279 MCAPI void $dtor();
280 // NOLINTEND
281
282public:
283 // virtual function thunks
284 // NOLINTBEGIN
285 MCAPI int $getContainerSize() const;
286
287 MCFOLD int $getMaxStackSize() const;
288
289 MCAPI ::std::string $getName() const;
290
291 MCAPI ::ItemStack const& $getItem(int slot) const;
292
293 MCAPI void $setItem(int slot, ::ItemStack const& item);
294
295 MCFOLD void $setItemWithForceBalance(int slot, ::ItemStack const& item, bool forceBalanced);
296
297 MCAPI void $serverInitItemStackIds(
298 int containerSlot,
299 int count,
300 ::std::function<void(int, ::ItemStack const&)> onNetIdChanged
301 );
302
303 MCAPI void $loadItems(::CompoundTag const& base, ::ILevel& level);
304
305 MCAPI void $load(::ILevel& level, ::CompoundTag const& base, ::DataLoadHelper& dataLoadHelper);
306
307 MCAPI bool $saveItems(::CompoundTag& base, ::SaveContext const& saveContext) const;
308
309 MCAPI bool $save(::CompoundTag& tag, ::SaveContext const& saveContext) const;
310
311 MCAPI bool $saveItemInstanceData(::CompoundTag& tag, ::SaveContext const& saveContext) const;
312
313 MCAPI void $tick(::BlockSource& region);
314
315 MCAPI void $triggerEvent(int b0, int b1);
316
317 MCAPI void $startOpen(::Actor& actor);
318
319 MCFOLD void $onRemoved(::BlockSource& region);
320
321 MCAPI void $stopOpen(::Actor& actor);
322
323 MCAPI void $onChanged(::BlockSource& region);
324
325 MCFOLD void $onNeighborChanged(::BlockSource& region, ::BlockPos const& position);
326
327 MCAPI ::BlockActor* $getCrackEntity(::BlockSource& region, ::BlockPos const& pos);
328
329 MCAPI int $clearInventory(int resizeTo);
330
331 MCFOLD ::Container* $getContainer();
332
333 MCFOLD ::Container const* $getContainer() const;
334
335 MCFOLD void $onMove();
336
337 MCAPI void $onPlace(::BlockSource& region);
338
339 MCAPI void $openBy(::Player& p);
340
341 MCAPI void $setContainerChanged(int slot);
342
343 MCFOLD bool $canPushInItem(int, int, ::ItemStack const&) const;
344
345 MCFOLD bool $canPullOutItem(int, int, ::ItemStack const&) const;
346
347 MCAPI void $getDebugText(
348 ::std::vector<::std::string>& outputInfo,
349 ::BlockPos const& debugPos,
350 ::BlockSource const* region
351 ) const;
352
353 MCAPI void $addContentChangeListener(::ContainerContentChangeListener* listener);
354
355 MCAPI void $removeContentChangeListener(::ContainerContentChangeListener* listener);
356
357 MCAPI void $initializeContainerContents(::BlockSource& region);
358
359 MCAPI ::std::unique_ptr<::BlockActorDataPacket> $_getUpdatePacket(::BlockSource& region);
360
361 MCFOLD void $_onUpdatePacket(::CompoundTag const& data, ::BlockSource& region);
362
363 MCAPI bool $_canOpenThis(::BlockSource& region) const;
364
365 MCAPI ::AABB $getObstructionAABB() const;
366
367 MCAPI bool $_detectEntityObstruction(::BlockSource& region) const;
368
369 MCAPI ::SharedTypes::Legacy::LevelSoundEvent $getOpenSound() const;
370
371 MCAPI ::SharedTypes::Legacy::LevelSoundEvent $getCloseSound() const;
372 // NOLINTEND
373
374public:
375 // vftables
376 // NOLINTBEGIN
377 MCAPI static void** $vftableForFillingContainer();
378
379 MCAPI static void** $vftableForRandomizableBlockActorContainerBase();
380 // NOLINTEND
381};
Definition AABB.h:18
Definition Actor.h:102
Definition BlockActor.h:32
Definition BlockPos.h:17
Definition BlockSource.h:66
Definition ChestBlockActor.h:40
Definition ChestBlockActor.h:32
Definition ChestBlock.h:28
Definition CompoundTag.h:13
Definition ContainerContentChangeListener.h:5
Definition Container.h:31
Definition DataLoadHelper.h:20
Definition ILevel.h:207
Definition ItemStack.h:23
Definition Player.h:123
Definition RandomizableBlockActorFillingContainer.h:16
Definition SaveContext.h:5
STL namespace.