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;
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 modelSlot, ::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: 45
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: 46
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: 47
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: 42
201 virtual ::std::unique_ptr<::BlockActorDataPacket> _getUpdatePacket(::BlockSource& region) /*override*/;
202
203 // vIndex: 43
204 virtual void _onUpdatePacket(::CompoundTag const& data, ::BlockSource& region) /*override*/;
205
206 // vIndex: 48
207 virtual bool _canOpenThis(::BlockSource& region) const;
208
209 // vIndex: 49
210 virtual ::AABB getObstructionAABB() const;
211
212 // vIndex: 50
213 virtual bool _detectEntityObstruction(::BlockSource& region) const;
214
215 // vIndex: 51
216 virtual ::SharedTypes::Legacy::LevelSoundEvent getOpenSound() const;
217
218 // vIndex: 52
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 playCloseSound(::BlockSource& region);
255
256 MCAPI void playOpenSound(::BlockSource& region);
257
258 MCAPI ::ChestBlock const* tryGetChestBlock(::BlockSource const& region) const;
259
260 MCAPI void unpair(::BlockSource& region);
261 // NOLINTEND
262
263public:
264 // constructor thunks
265 // NOLINTBEGIN
266 MCAPI void* $ctor(
267 ::BlockActorType type,
268 ::BlockActorRendererId renderId,
269 ::std::optional<::ChestType> chestType,
270 ::BlockPos const& pos
271 );
272 // NOLINTEND
273
274public:
275 // destructor thunk
276 // NOLINTBEGIN
277 MCAPI void $dtor();
278 // NOLINTEND
279
280public:
281 // virtual function thunks
282 // NOLINTBEGIN
283 MCAPI int $getContainerSize() const;
284
285 MCFOLD int $getMaxStackSize() const;
286
287 MCAPI ::std::string $getName() const;
288
289 MCAPI ::ItemStack const& $getItem(int slot) const;
290
291 MCAPI void $setItem(int modelSlot, ::ItemStack const& item);
292
293 MCFOLD void $setItemWithForceBalance(int slot, ::ItemStack const& item, bool forceBalanced);
294
295 MCAPI void $serverInitItemStackIds(
296 int containerSlot,
297 int count,
298 ::std::function<void(int, ::ItemStack const&)> onNetIdChanged
299 );
300
301 MCAPI void $loadItems(::CompoundTag const& base, ::ILevel& level);
302
303 MCAPI void $load(::ILevel& level, ::CompoundTag const& base, ::DataLoadHelper& dataLoadHelper);
304
305 MCAPI bool $saveItems(::CompoundTag& base, ::SaveContext const& saveContext) const;
306
307 MCAPI bool $save(::CompoundTag& tag, ::SaveContext const& saveContext) const;
308
309 MCAPI bool $saveItemInstanceData(::CompoundTag& tag, ::SaveContext const& saveContext) const;
310
311 MCAPI void $tick(::BlockSource& region);
312
313 MCAPI void $triggerEvent(int b0, int b1);
314
315 MCAPI void $startOpen(::Actor& actor);
316
317 MCFOLD void $onRemoved(::BlockSource& region);
318
319 MCAPI void $stopOpen(::Actor& actor);
320
321 MCAPI void $onChanged(::BlockSource& region);
322
323 MCFOLD void $onNeighborChanged(::BlockSource& region, ::BlockPos const& position);
324
325 MCAPI ::BlockActor* $getCrackEntity(::BlockSource& region, ::BlockPos const& pos);
326
327 MCAPI int $clearInventory(int resizeTo);
328
329 MCFOLD ::Container* $getContainer();
330
331 MCFOLD ::Container const* $getContainer() const;
332
333 MCFOLD void $onMove();
334
335 MCAPI void $onPlace(::BlockSource& region);
336
337 MCAPI void $openBy(::Player& p);
338
339 MCAPI void $setContainerChanged(int slot);
340
341 MCFOLD bool $canPushInItem(int, int, ::ItemStack const&) const;
342
343 MCFOLD bool $canPullOutItem(int, int, ::ItemStack const&) const;
344
345 MCAPI void $getDebugText(
346 ::std::vector<::std::string>& outputInfo,
347 ::BlockPos const& debugPos,
348 ::BlockSource const* region
349 ) const;
350
351 MCAPI void $addContentChangeListener(::ContainerContentChangeListener* listener);
352
353 MCAPI void $removeContentChangeListener(::ContainerContentChangeListener* listener);
354
355 MCAPI void $initializeContainerContents(::BlockSource& region);
356
357 MCAPI ::std::unique_ptr<::BlockActorDataPacket> $_getUpdatePacket(::BlockSource& region);
358
359 MCFOLD void $_onUpdatePacket(::CompoundTag const& data, ::BlockSource& region);
360
361 MCAPI bool $_canOpenThis(::BlockSource& region) const;
362
363 MCAPI ::AABB $getObstructionAABB() const;
364
365 MCAPI bool $_detectEntityObstruction(::BlockSource& region) const;
366
367 MCAPI ::SharedTypes::Legacy::LevelSoundEvent $getOpenSound() const;
368
369 MCAPI ::SharedTypes::Legacy::LevelSoundEvent $getCloseSound() const;
370 // NOLINTEND
371
372public:
373 // vftables
374 // NOLINTBEGIN
375 MCAPI static void** $vftableForFillingContainer();
376
377 MCAPI static void** $vftableForRandomizableBlockActorContainerBase();
378 // NOLINTEND
379};
Definition AABB.h:18
Definition Actor.h:102
Definition BlockActorDataPacket.h:19
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:211
Definition ItemStack.h:23
Definition Player.h:123
Definition RandomizableBlockActorFillingContainer.h:16
Definition SaveContext.h:5
STL namespace.