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