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