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