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