Skip to content
LeviMC
English
AutoLightDark
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/VanillaBlockActor.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 ::VanillaBlockActor, 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 slot) 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 // NOLINTEND
84
85public:
86 // member functions
87 // NOLINTBEGIN
88 MCNAPI explicit ShelfBlockActor(::BlockPos const& pos);
89
90 MCNAPI void _setItemInternal(int slot, ::ItemStack const& item, bool isLoading, bool emitVibrations);
91
92 MCNAPI void updateItemCalculators(::ItemStack const& item, ::BlockSource const& region);
93 // NOLINTEND
94
95public:
96 // constructor thunks
97 // NOLINTBEGIN
98 MCNAPI void* $ctor(::BlockPos const& pos);
99 // NOLINTEND
100
101public:
102 // virtual function thunks
103 // NOLINTBEGIN
104 MCNAPI ::std::string $getName() const;
105
106 MCNAPI void $tick(::BlockSource& region);
107
108 MCNAPI void $onChanged(::BlockSource& region);
109
110 MCNAPI void $onRemoved(::BlockSource& region);
111
112 MCNAPI ::Container* $getContainer();
113
114 MCNAPI ::Container const* $getContainer() const;
115
116 MCNAPI ::ItemStack const& $getItem(int slot) const;
117
118 MCNAPI void $setItem(int slot, ::ItemStack const& item);
119
120 MCNAPI int $getMaxStackSize() const;
121
122 MCNAPI int $getContainerSize() const;
123
124 MCNAPI void $startOpen(::Actor&);
125
126 MCNAPI void $stopOpen(::Actor& actor);
127
129 int containerSlot,
130 int count,
131 ::std::function<void(int, ::ItemStack const&)> onNetIdChanged
132 );
133
134 MCNAPI void $load(::ILevel& level, ::CompoundTag const& tag, ::DataLoadHelper& dataLoadHelper);
135
136 MCNAPI bool $save(::CompoundTag& tag, ::SaveContext const& saveContext) const;
137
138 MCNAPI ::std::unique_ptr<::BlockActorDataPacket> $_getUpdatePacket(::BlockSource&);
139
140 MCNAPI void $_onUpdatePacket(::CompoundTag const& data, ::BlockSource& region);
141
142
143 // NOLINTEND
144};
Definition Actor.h:116
Definition BlockActorDataPacket.h:19
Definition BlockPos.h:14
Definition BlockSource.h:72
Definition CompoundTag.h:18
Definition DataLoadHelper.h:20
Definition ILevel.h:223
Definition ItemStack.h:26
Definition SaveContext.h:5
MCAPI int $getMaxStackSize() const
MCAPI void $startOpen(::Actor &)
MCAPI void $stopOpen(::Actor &actor)
MCAPI void $onChanged(::BlockSource &region)
MCAPI void * $ctor(::BlockPos const &pos)
MCAPI::std::string $getName() const
MCAPI bool $save(::CompoundTag &tag, ::SaveContext const &saveContext) const
MCAPI void $onRemoved(::BlockSource &region)
MCAPI::ItemStack const & $getItem(int slot) const
MCAPI void updateItemCalculators(::ItemStack const &item, ::BlockSource const &region)
MCAPI void $serverInitItemStackIds(int containerSlot, int count, ::std::function< void(int, ::ItemStack const &)> onNetIdChanged)
MCAPI ShelfBlockActor(::BlockPos const &pos)
MCAPI int $getContainerSize() const
MCAPI void $setItem(int slot, ::ItemStack const &item)
MCAPI void _setItemInternal(int slot, ::ItemStack const &item, bool isLoading, bool emitVibrations)
MCAPI void $_onUpdatePacket(::CompoundTag const &data, ::BlockSource &region)
MCAPI void $tick(::BlockSource &region)
MCAPI::Container const * $getContainer() const
MCAPI::Container * $getContainer()
MCAPI ::std::unique_ptr<::BlockActorDataPacket > $_getUpdatePacket(::BlockSource &)
MCAPI void $load(::ILevel &level, ::CompoundTag const &tag, ::DataLoadHelper &dataLoadHelper)