LeviLamina
Loading...
Searching...
No Matches
FillingContainer.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/shared_types/legacy/ContainerType.h"
7#include "mc/world/Container.h"
8
9// auto generated forward declare list
10// clang-format off
11class Actor;
12class ItemStack;
13class ListTag;
14class Player;
15class SaveContext;
16// clang-format on
17
18class FillingContainer : public ::Container {
19public:
20 // FillingContainer inner types define
21 using ItemList = ::std::vector<::ItemStack>;
22
23public:
24 // member variables
25 // NOLINTBEGIN
26 ::ll::TypedStorage<8, 24, ::std::vector<::ItemStack>> mItems;
27 ::ll::TypedStorage<8, 8, ::Player*> mPlayer;
28 // NOLINTEND
29
30public:
31 // prevent constructor by default
32 FillingContainer();
33
34public:
35 // virtual functions
36 // NOLINTBEGIN
37 virtual ~FillingContainer() /*override*/;
38
39 virtual int removeResource(::ItemStack const& item, bool requireExactAux, bool requireExactData, int maxCount);
40
41 virtual void swapSlots(int from, int to);
42
43 virtual bool add(::ItemStack& item);
44
45 virtual bool canAdd(::ItemStack const& item) const;
46
47 virtual void removeItem(int slot, int count) /*override*/;
48
49 virtual void clearSlot(int slot);
50
51 virtual int clearInventory(int resizeTo);
52
53 virtual ::std::unique_ptr<::ListTag> saveToTag(::SaveContext const& saveContext) const;
54
55 virtual void loadFromTag(::ListTag const& inventoryList);
56
57 virtual void setItem(int slot, ::ItemStack const& item) /*override*/;
58
59 virtual void setItemWithForceBalance(int slot, ::ItemStack const& item, bool forceBalanced) /*override*/;
60
61 virtual ::ItemStack const& getItem(int slot) const /*override*/;
62
63 virtual int getMaxStackSize() const /*override*/;
64
65 virtual int getContainerSize() const /*override*/;
66
67 virtual void startOpen(::Actor& actor) /*override*/;
68
69 virtual void serverInitItemStackIds(
70 int containerSlot,
71 int count,
72 ::std::function<void(int, ::ItemStack const&)> onNetIdChanged
73 ) /*override*/;
74
75 virtual void _trySetInSlot(::ItemStack& item, int const& slot, int const& inventorySize, int& backCompatOffset);
76 // NOLINTEND
77
78public:
79 // member functions
80 // NOLINTBEGIN
81 MCAPI FillingContainer(::Player* player, int numTotalSlots, ::SharedTypes::Legacy::ContainerType containerType);
82
83 MCAPI int _addResource(::ItemStack const& item);
84
85 MCAPI void _doDrop(::ItemStack& item, bool randomly);
86
87 MCAPI int _getFreeSlot() const;
88
89 MCAPI int _getSlotWithRemainingSpace(::ItemStack const& newItem) const;
90
91 MCAPI bool _isCreative() const;
92
93 MCAPI void _release(int slot);
94
95 MCFOLD int getHotbarSize() const;
96
97 MCAPI int getSlotWithItem(::ItemStack const& item, bool checkAux, bool checkData) const;
98
99 MCAPI bool hasResource(int type);
100
101 MCAPI bool removeResource(int type);
102 // NOLINTEND
103
104public:
105 // constructor thunks
106 // NOLINTBEGIN
107 MCAPI void* $ctor(::Player* player, int numTotalSlots, ::SharedTypes::Legacy::ContainerType containerType);
108 // NOLINTEND
109
110public:
111 // destructor thunk
112 // NOLINTBEGIN
113 MCAPI void $dtor();
114 // NOLINTEND
115
116public:
117 // virtual function thunks
118 // NOLINTBEGIN
119 MCAPI int $removeResource(::ItemStack const& item, bool requireExactAux, bool requireExactData, int maxCount);
120
121 MCAPI void $swapSlots(int from, int to);
122
123 MCAPI bool $add(::ItemStack& item);
124
125 MCAPI bool $canAdd(::ItemStack const& item) const;
126
127 MCAPI void $removeItem(int slot, int count);
128
129 MCAPI void $clearSlot(int slot);
130
131 MCAPI int $clearInventory(int resizeTo);
132
133 MCAPI ::std::unique_ptr<::ListTag> $saveToTag(::SaveContext const& saveContext) const;
134
135 MCAPI void $loadFromTag(::ListTag const& inventoryList);
136
137 MCFOLD void $setItem(int slot, ::ItemStack const& item);
138
139 MCAPI void $setItemWithForceBalance(int slot, ::ItemStack const& item, bool forceBalanced);
140
141 MCAPI ::ItemStack const& $getItem(int slot) const;
142
143 MCFOLD int $getMaxStackSize() const;
144
145 MCFOLD int $getContainerSize() const;
146
147 MCFOLD void $startOpen(::Actor& actor);
148
149 MCFOLD void $serverInitItemStackIds(
150 int containerSlot,
151 int count,
152 ::std::function<void(int, ::ItemStack const&)> onNetIdChanged
153 );
154
155 MCAPI void $_trySetInSlot(::ItemStack& item, int const& slot, int const& inventorySize, int& backCompatOffset);
156
157
158 // NOLINTEND
159
160public:
161 // vftables
162 // NOLINTBEGIN
163 MCAPI static void** $vftable();
164 // NOLINTEND
165};
Definition Actor.h:125
Definition ItemStack.h:35
Definition ListTag.h:21
Definition Player.h:137
Definition SaveContext.h:5