LeviLamina
Loading...
Searching...
No Matches
ContainerController.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/world/containers/controllers/ItemAddType.h"
7#include "mc/world/containers/controllers/ItemPlaceType.h"
8#include "mc/world/containers/controllers/ItemSetType.h"
9
10// auto generated forward declare list
11// clang-format off
12class ContainerModel;
14class ItemInstance;
15class ItemStack;
16class ItemStackBase;
17class Recipes;
19// clang-format on
20
21class ContainerController {
22public:
23 // member variables
24 // NOLINTBEGIN
25 ::ll::TypedStorage<8, 16, ::std::weak_ptr<::ContainerModel>> mContainerModel;
26 ::ll::TypedStorage<1, 1, bool> mDrop;
27 // NOLINTEND
28
29#ifdef LL_PLAT_S
30#else // LL_PLAT_C
31public:
32 // prevent constructor by default
33 ContainerController();
34
35#endif
36public:
37 // virtual functions
38 // NOLINTBEGIN
39 virtual ~ContainerController() = default;
40
41#ifdef LL_PLAT_S
42 virtual ::ItemInstance const& getRecipeItem(int) const;
43#else // LL_PLAT_C
44 virtual ::ItemInstance const& getRecipeItem(int slot) const;
45#endif
46
47#ifdef LL_PLAT_S
48 virtual bool canRemove(int, int) const;
49#else // LL_PLAT_C
50 virtual bool canRemove(int slot, int removeCount) const;
51#endif
52
53#ifdef LL_PLAT_S
54 virtual bool isItemAllowed(::ItemStackBase const&) const;
55#else // LL_PLAT_C
56 virtual bool isItemAllowed(::ItemStackBase const& item) const;
57#endif
58
59#ifdef LL_PLAT_S
60 virtual bool isItemFiltered(::Recipes const&, ::ItemStackBase const&) const;
61#else // LL_PLAT_C
62 virtual bool isItemFiltered(::Recipes const& recipes, ::ItemStackBase const& item) const;
63#endif
64
65#ifdef LL_PLAT_S
66 virtual int getBackgroundStyle(int, bool) const;
67#else // LL_PLAT_C
68 virtual int getBackgroundStyle(int slot, bool inventoryContainsItem) const;
69#endif
70
71#ifdef LL_PLAT_S
72 virtual ::ItemSetType
73 _canSet(::ContainerScreenContext const&, int, ::ItemStackBase const&, ::ItemTransferAmount) const;
74#else // LL_PLAT_C
75 virtual ::ItemSetType _canSet(
77 int modelSlot,
78 ::ItemStackBase const& item,
79 ::ItemTransferAmount transferAmount
80 ) const;
81#endif
82
83#ifdef LL_PLAT_S
84 virtual int _getAvailableSetCount(::ContainerScreenContext const&, int, ::ItemStackBase const&) const;
85#else // LL_PLAT_C
86 virtual int
87 _getAvailableSetCount(::ContainerScreenContext const& context, int modelSlot, ::ItemStackBase const& item) const;
88#endif
89
90#ifdef LL_PLAT_S
91 virtual bool _canRemove(int, int) const;
92#else // LL_PLAT_C
93 virtual bool _canRemove(int modelSlot, int removeCount) const;
94#endif
95
96 virtual void _onItemChanged(int);
97 // NOLINTEND
98
99public:
100 // member functions
101 // NOLINTBEGIN
102#ifdef LL_PLAT_C
103 MCAPI ContainerController(::std::weak_ptr<::ContainerModel> containerModel, bool shouldDrop);
104
105 MCAPI int _addItem(::ContainerScreenContext const& context, int modelSlot, int addCount);
106
107 MCAPI ::ItemAddType _canAdd(
109 int slot,
110 ::ItemStackBase const& item,
111 ::ItemTransferAmount transferAmount
112 ) const;
113
114 MCFOLD bool canConsume(int modelSlot, int removeCount) const;
115
116 MCFOLD bool canDestroy(int modelSlot, int removeCount) const;
117
118 MCFOLD bool canDrop(int modelSlot, int removeCount) const;
119
120 MCAPI ::ItemSetType canSet(
122 int modelSlot,
123 ::ItemStackBase const& item,
124 ::ItemTransferAmount transferAmount,
125 bool allowSwap
126 ) const;
127
128 MCAPI int
129 getAvailableAddCount(::ContainerScreenContext const& context, int modelSlot, ::ItemStackBase const& fillItem) const;
130
131 MCAPI ::std::weak_ptr<::ContainerModel> getContainerModel() const;
132
133 MCAPI ::std::string const& getContainerName() const;
134
135 MCAPI int getContainerSize() const;
136
137 MCFOLD ::ItemInstance const& getItemInstance(int slot) const;
138
139 MCAPI ::ItemStack const& getItemStack(int slot) const;
140
141 MCAPI ::ItemStackBase const& getItemStackBase(int slot) const;
142
143 MCAPI bool isExpandableItemFiltered(int slot) const;
144
145 MCAPI bool isItemInstanceBased() const;
146
147 MCAPI ::ItemStack removeItem(int slot, int removeCount);
148
149 MCAPI bool setItem(
151 int slot,
152 ::ItemStack& stack,
153 ::ItemPlaceType type,
154 bool allowSwap
155 );
156#endif
157 // NOLINTEND
158
159public:
160 // constructor thunks
161 // NOLINTBEGIN
162#ifdef LL_PLAT_C
163 MCAPI void* $ctor(::std::weak_ptr<::ContainerModel> containerModel, bool shouldDrop);
164#endif
165 // NOLINTEND
166
167public:
168 // virtual function thunks
169 // NOLINTBEGIN
170#ifdef LL_PLAT_C
171 MCFOLD ::ItemInstance const& $getRecipeItem(int slot) const;
172
173 MCAPI bool $canRemove(int slot, int removeCount) const;
174
175 MCFOLD bool $isItemAllowed(::ItemStackBase const& item) const;
176
177 MCAPI bool $isItemFiltered(::Recipes const& recipes, ::ItemStackBase const& item) const;
178
179 MCFOLD int $getBackgroundStyle(int slot, bool inventoryContainsItem) const;
180
181 MCAPI ::ItemSetType $_canSet(
183 int modelSlot,
184 ::ItemStackBase const& item,
185 ::ItemTransferAmount transferAmount
186 ) const;
187
188 MCAPI int
189 $_getAvailableSetCount(::ContainerScreenContext const& context, int modelSlot, ::ItemStackBase const& item) const;
190
191 MCAPI bool $_canRemove(int modelSlot, int removeCount) const;
192
193 MCFOLD void $_onItemChanged(int);
194#endif
195
196
197 // NOLINTEND
198
199public:
200 // vftables
201 // NOLINTBEGIN
202 MCNAPI static void** $vftable();
203 // NOLINTEND
204};
static MCAPI void ** $vftable()
Definition ContainerModel.h:28
Definition ContainerScreenContext.h:19
Definition ItemInstance.h:15
Definition ItemStackBase.h:52
Definition ItemStack.h:35
Definition Recipes.h:36
Definition ItemTransferAmount.h:9
Definition context.h:5