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 CompoundTag;
22class Container;
24class DataLoadHelper;
25class ILevel;
27class ItemStack;
28class Player;
29class SaveContext;
30// clang-format on
31
32class ChestBlockActor : public ::RandomizableBlockActorFillingContainer {
33public:
34 // ChestBlockActor inner types declare
35 // clang-format off
36 class ChestCloser;
37 // clang-format on
38
39 // ChestBlockActor inner types define
40 class ChestCloser {
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&);
52 ChestCloser(ChestCloser const&);
53 ChestCloser();
54
55 public:
56 // member functions
57 // NOLINTBEGIN
58 MCAPI void close();
59 // NOLINTEND
60 };
61
62public:
63 // member variables
64 // NOLINTBEGIN
65 ::ll::TypedStorage<4, 4, float> mSpeed;
66 ::ll::TypedStorage<1, 1, bool> mIsGlobalChest;
67 ::ll::TypedStorage<1, 1, bool> mAlwayCheckObstructionComponent;
68 ::ll::TypedStorage<4, 4, float> mObstructionHeight;
69 bool mPairLead : 1;
70 ::ll::TypedStorage<4, 4, float> mOpenness;
71 ::ll::TypedStorage<4, 4, float> mOldOpenness;
72 ::ll::TypedStorage<1, 1, bool> mIsOpen;
73 ::ll::TypedStorage<4, 4, int> mTickInterval;
74 bool mPairingChanged : 1;
75 bool mAlongX : 1;
76 bool mDeferredPairLoad : 1;
77 bool mConverted : 1;
78 ::ll::TypedStorage<4, 4, int> mDeferredPairX;
79 ::ll::TypedStorage<4, 4, int> mDeferredPairZ;
80 ::ll::TypedStorage<8, 8, ::ChestBlockActor*> mLargeChestPaired;
81 ::ll::TypedStorage<4, 12, ::BlockPos> mLargeChestPairedPosition;
82 ::ll::TypedStorage<1, 2, ::std::optional<::ChestType>> mChestType;
83 ::ll::TypedStorage<1, 1, bool> mIsFindable;
84 ::ll::TypedStorage<8, 64, ::std::unordered_set<::ActorUniqueID>> mOpenedByIds;
85 ::ll::TypedStorage<4, 4, int> mUpdateFlags;
86 ::ll::TypedStorage<8, 24, ::std::vector<::std::shared_ptr<::ChestBlockActor::ChestCloser>>> mChestClosers;
87 // NOLINTEND
88
89public:
90 // prevent constructor by default
91 ChestBlockActor();
92
93public:
94 // virtual functions
95 // NOLINTBEGIN
96 virtual ~ChestBlockActor() /*override*/;
97
98 virtual bool isTypeOrDerived(::BlockActorType type) const /*override*/;
99
100 virtual int getContainerSize() const /*override*/;
101
102 virtual int getMaxStackSize() const /*override*/;
103
104 virtual ::std::string getName() const /*override*/;
105
106 virtual ::ItemStack const& getItem(int slot) const /*override*/;
107
108 virtual void setItem(int slot, ::ItemStack const& item) /*override*/;
109
110 virtual void setItemWithForceBalance(int slot, ::ItemStack const& item, bool forceBalanced) /*override*/;
111
112 virtual void serverInitItemStackIds(
113 int containerSlot,
114 int count,
115 ::std::function<void(int, ::ItemStack const&)> onNetIdChanged
116 ) /*override*/;
117
118 virtual void loadItems(::CompoundTag const& base, ::ILevel& level);
119
120 virtual void load(::ILevel& level, ::CompoundTag const& base, ::DataLoadHelper& dataLoadHelper) /*override*/;
121
122 virtual bool saveItems(::CompoundTag& base, ::SaveContext const& saveContext) const;
123
124 virtual bool save(::CompoundTag& tag, ::SaveContext const& saveContext) const /*override*/;
125
126 virtual bool saveItemInstanceData(::CompoundTag& base) const /*override*/;
127
128 virtual void tick(::BlockSource& region) /*override*/;
129
130 virtual void triggerEvent(int b0, int b1) /*override*/;
131
132 virtual void startOpen(::Actor& actor) /*override*/;
133
134 virtual void onRemoved(::BlockSource& region) /*override*/;
135
136 virtual void stopOpen(::Actor& actor) /*override*/;
137
138 virtual void onChanged(::BlockSource& region) /*override*/;
139
140 virtual void onNeighborChanged(::BlockSource& region, ::BlockPos const& position) /*override*/;
141
143 getCrackEntity(::BlockSource& region, ::BlockPos const& pos) /*override*/;
144
145 virtual int clearInventory(int resizeTo) /*override*/;
146
147 virtual ::Container* getContainer() /*override*/;
148
149 virtual ::Container const* getContainer() const /*override*/;
150
151 virtual void onMove() /*override*/;
152
153 virtual void onPlace(::BlockSource& region) /*override*/;
154
155 virtual void openBy(::Player& p);
156
157 virtual void setContainerChanged(int slot) /*override*/;
158
159 virtual bool canPushInItem(int slot, int face, ::ItemStack const& item) const /*override*/;
160
161 virtual bool canPullOutItem(int, int, ::ItemStack const&) const /*override*/;
162
163 virtual void getDebugText(
164 ::std::vector<::std::string>& outputInfo,
165 ::BlockPos const& debugPos,
166 ::BlockSource const* region
167 ) const /*override*/;
168
169 virtual void addContentChangeListener(::ContainerContentChangeListener* listener) /*override*/;
170
171 virtual void removeContentChangeListener(::ContainerContentChangeListener* listener) /*override*/;
172
173 virtual void initializeContainerContents(::BlockSource& region) /*override*/;
174
175 virtual ::std::unique_ptr<::BlockActorDataPacket> _getUpdatePacket(::BlockSource& region) /*override*/;
176
177 virtual void _onUpdatePacket(::CompoundTag const& data, ::BlockSource& region) /*override*/;
178
179 virtual bool _canOpenThis(::BlockSource& region) const;
180
181 virtual ::AABB getObstructionAABB() const;
182
183 virtual bool _detectEntityObstruction(::BlockSource& region) const;
184
185 virtual ::SharedTypes::Legacy::LevelSoundEvent getOpenSound() const;
186
187 virtual ::SharedTypes::Legacy::LevelSoundEvent getCloseSound() const;
188 // NOLINTEND
189
190public:
191 // member functions
192 // NOLINTBEGIN
193 MCAPI ChestBlockActor(
194 ::BlockActorType type,
195 ::BlockActorRendererId renderId,
196 ::std::optional<::ChestType> chestType,
197 ::BlockPos const& pos
198 );
199
200 MCAPI void _closeChest(::BlockSource& region, ::Actor* actor);
201
202 MCAPI void _pairWith(::ChestBlockActor* chest, ::BlockSource& region, bool isLead);
203
204 MCAPI bool _saveClientSideState(::CompoundTag& tag, ::SaveContext const& saveContext) const;
205
206 MCAPI void _tryToPairWith(::BlockSource& region, ::BlockPos const& position);
207
208 MCAPI bool canPairWith(::BlockActor* entity, ::BlockSource& region);
209
210 MCAPI ::std::weak_ptr<::ChestBlockActor::ChestCloser> getChestCloser(::Actor& closingActor);
211
212 MCAPI void unpair(::BlockSource& region);
213 // NOLINTEND
214
215public:
216 // static functions
217 // NOLINTBEGIN
218 MCAPI static ::std::unique_ptr<::ChestBlockActor>
219 createChestBlockEntity(::std::optional<::ChestType> const& chestType, ::BlockPos const& pos);
220 // NOLINTEND
221
222public:
223 // constructor thunks
224 // NOLINTBEGIN
225 MCAPI void* $ctor(
226 ::BlockActorType type,
227 ::BlockActorRendererId renderId,
228 ::std::optional<::ChestType> chestType,
229 ::BlockPos const& pos
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 bool $isTypeOrDerived(::BlockActorType type) const;
243
244 MCAPI int $getContainerSize() const;
245
246 MCFOLD int $getMaxStackSize() const;
247
248 MCAPI ::std::string $getName() const;
249
250 MCAPI ::ItemStack const& $getItem(int slot) const;
251
252 MCAPI void $setItem(int slot, ::ItemStack const& item);
253
254 MCFOLD void $setItemWithForceBalance(int slot, ::ItemStack const& item, bool forceBalanced);
255
256 MCAPI void $serverInitItemStackIds(
257 int containerSlot,
258 int count,
259 ::std::function<void(int, ::ItemStack const&)> onNetIdChanged
260 );
261
262 MCAPI void $loadItems(::CompoundTag const& base, ::ILevel& level);
263
264 MCAPI void $load(::ILevel& level, ::CompoundTag const& base, ::DataLoadHelper& dataLoadHelper);
265
266 MCAPI bool $saveItems(::CompoundTag& base, ::SaveContext const& saveContext) const;
267
268 MCAPI bool $save(::CompoundTag& tag, ::SaveContext const& saveContext) const;
269
270 MCAPI bool $saveItemInstanceData(::CompoundTag& base) const;
271
272 MCAPI void $tick(::BlockSource& region);
273
274 MCAPI void $triggerEvent(int b0, int b1);
275
276 MCAPI void $startOpen(::Actor& actor);
277
278 MCAPI void $onRemoved(::BlockSource& region);
279
280 MCAPI void $stopOpen(::Actor& actor);
281
282 MCAPI void $onChanged(::BlockSource& region);
283
284 MCFOLD void $onNeighborChanged(::BlockSource& region, ::BlockPos const& position);
285
286 MCAPI ::IVanillaRenderBlockActorComponent* $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 slot, int face, ::ItemStack const& item) const;
303
304 MCFOLD bool $canPullOutItem(int, int, ::ItemStack const&) const;
305
306 MCAPI void $getDebugText(
307 ::std::vector<::std::string>& outputInfo,
308 ::BlockPos const& debugPos,
309 ::BlockSource const* region
310 ) 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 bool $_canOpenThis(::BlockSource& region) const;
323
324 MCAPI ::AABB $getObstructionAABB() const;
325
326 MCAPI bool $_detectEntityObstruction(::BlockSource& region) const;
327
328 MCAPI ::SharedTypes::Legacy::LevelSoundEvent $getOpenSound() const;
329
330 MCAPI ::SharedTypes::Legacy::LevelSoundEvent $getCloseSound() const;
331
332
333 // NOLINTEND
334
335public:
336 // vftables
337 // NOLINTBEGIN
339
341
343
344 MCNAPI static void** $vftableForBlockActor();
345
346 MCNAPI static void** $vftable();
347 // NOLINTEND
348};
Definition AABB.h:18
Definition Actor.h:113
Definition BlockActorDataPacket.h:19
Definition BlockActor.h:29
Definition BlockPos.h:17
Definition BlockSource.h:71
Definition ChestBlockActor.h:40
static MCAPI void ** $vftableForIVanillaMainBlockActorComponent()
static MCAPI void ** $vftableForIVanillaTickBlockActorComponent()
static MCAPI void ** $vftableForIVanillaRenderBlockActorComponent()
static MCAPI void ** $vftable()
static MCAPI void ** $vftableForBlockActor()
Definition CompoundTag.h:18
Definition ContainerContentChangeListener.h:5
Definition Container.h:35
Definition DataLoadHelper.h:20
Definition ILevel.h:221
Definition IVanillaRenderBlockActorComponent.h:19
Definition ItemStack.h:26
Definition Player.h:129
Definition SaveContext.h:5
STL namespace.