LeviLamina
Loading...
Searching...
No Matches
ShelfBlockActor.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/ecs/WeakEntityRef.h"
7#include "mc/world/Container.h"
8#include "mc/world/item/ClockSpriteCalculator.h"
9#include "mc/world/item/CompassSpriteCalculator.h"
10#include "mc/world/level/block/actor/BlockActor.h"
11
12// auto generated forward declare list
13// clang-format off
14class Actor;
16class BlockPos;
17class BlockSource;
18class CompoundTag;
19class DataLoadHelper;
20class ILevel;
21class ItemStack;
22class SaveContext;
23// clang-format on
24
25class ShelfBlockActor : public ::BlockActor, public ::Container {
26public:
27 // member variables
28 // NOLINTBEGIN
29 ::ll::TypedStorage<4, 12, ::ClockSpriteCalculator> mClockSpriteCalc;
30 ::ll::TypedStorage<8, 32, ::CompassSpriteCalculator> mCompassSpriteCalc;
31 ::ll::TypedStorage<8, 32, ::CompassSpriteCalculator> mRecoveryCompassSpriteCalc;
32 ::ll::TypedStorage<1, 1, bool> mUpdateCalculators;
33 ::ll::TypedStorage<8, 24, ::std::vector<::ItemStack>> mItems;
34 ::ll::TypedStorage<1, 1, bool> mIgnoreLighting;
35 ::ll::TypedStorage<8, 24, ::WeakEntityRef> mDisplayEntity;
36 ::ll::TypedStorage<1, 1, bool> mEmitSingleItemSwapVibration;
37 // NOLINTEND
38
39public:
40 // prevent constructor by default
41 ShelfBlockActor();
42
43public:
44 // virtual functions
45 // NOLINTBEGIN
46 virtual ::std::string getName() const /*override*/;
47
48 virtual void tick(::BlockSource& region) /*override*/;
49
50 virtual void onChanged(::BlockSource& region) /*override*/;
51
52 virtual void onRemoved(::BlockSource& region) /*override*/;
53
54 virtual ::Container* getContainer() /*override*/;
55
56 virtual ::Container const* getContainer() const /*override*/;
57
58 virtual ::ItemStack const& getItem(int index) const /*override*/;
59
60 virtual void setItem(int slot, ::ItemStack const& item) /*override*/;
61
62 virtual int getMaxStackSize() const /*override*/;
63
64 virtual int getContainerSize() const /*override*/;
65
66 virtual void startOpen(::Actor&) /*override*/;
67
68 virtual void stopOpen(::Actor& actor) /*override*/;
69
70 virtual void serverInitItemStackIds(
71 int containerSlot,
72 int count,
73 ::std::function<void(int, ::ItemStack const&)> onNetIdChanged
74 ) /*override*/;
75
76 virtual void load(::ILevel& level, ::CompoundTag const& tag, ::DataLoadHelper& dataLoadHelper) /*override*/;
77
78 virtual bool save(::CompoundTag& tag, ::SaveContext const& saveContext) const /*override*/;
79
80 virtual ::std::unique_ptr<::BlockActorDataPacket> _getUpdatePacket(::BlockSource&) /*override*/;
81
82 virtual void _onUpdatePacket(::CompoundTag const& data, ::BlockSource& region) /*override*/;
83
84 virtual ~ShelfBlockActor() /*override*/ = default;
85 // NOLINTEND
86
87public:
88 // member functions
89 // NOLINTBEGIN
90 MCAPI explicit ShelfBlockActor(::BlockPos const& pos);
91
92 MCAPI void _loadItems(::CompoundTag const& base, ::ILevel& level);
93
94 MCAPI void _setItemInternal(int slot, ::ItemStack const& item, bool isLoading, bool emitVibrations);
95
96 MCAPI void updateItemCalculators(::ItemStack const& item, ::BlockSource const& region);
97 // NOLINTEND
98
99public:
100 // constructor thunks
101 // NOLINTBEGIN
102 MCAPI void* $ctor(::BlockPos const& pos);
103 // NOLINTEND
104
105public:
106 // virtual function thunks
107 // NOLINTBEGIN
108 MCAPI ::std::string $getName() const;
109
110 MCAPI void $tick(::BlockSource& region);
111
112 MCAPI void $onChanged(::BlockSource& region);
113
114 MCAPI void $onRemoved(::BlockSource& region);
115
116 MCFOLD ::Container* $getContainer();
117
118 MCFOLD ::Container const* $getContainer() const;
119
120 MCAPI ::ItemStack const& $getItem(int index) const;
121
122 MCAPI void $setItem(int slot, ::ItemStack const& item);
123
124 MCFOLD int $getMaxStackSize() const;
125
126 MCFOLD int $getContainerSize() const;
127
128 MCFOLD void $startOpen(::Actor&);
129
130 MCFOLD void $stopOpen(::Actor& actor);
131
132 MCAPI void $serverInitItemStackIds(
133 int containerSlot,
134 int count,
135 ::std::function<void(int, ::ItemStack const&)> onNetIdChanged
136 );
137
138 MCAPI void $load(::ILevel& level, ::CompoundTag const& tag, ::DataLoadHelper& dataLoadHelper);
139
140 MCAPI bool $save(::CompoundTag& tag, ::SaveContext const& saveContext) const;
141
142 MCFOLD ::std::unique_ptr<::BlockActorDataPacket> $_getUpdatePacket(::BlockSource&);
143
144 MCFOLD void $_onUpdatePacket(::CompoundTag const& data, ::BlockSource& region);
145
146
147 // NOLINTEND
148
149public:
150 // vftables
151 // NOLINTBEGIN
152 MCAPI static void** $vftableForBlockActor();
153
154 MCAPI static void** $vftableForContainer();
155 // NOLINTEND
156};
Definition Actor.h:105
Definition BlockActorDataPacket.h:19
Definition BlockPos.h:19
Definition BlockSource.h:68
Definition CompoundTag.h:23
Definition DataLoadHelper.h:20
Definition ILevel.h:214
Definition ItemStack.h:26
Definition SaveContext.h:5