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
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
29public:
30 // virtual functions
31 // NOLINTBEGIN
32 virtual ~ContainerController() = default;
33
34 virtual ::ItemInstance const& getRecipeItem(int index) const;
35
36 virtual bool canRemove(int slot, int removeCount) const;
37
38 virtual bool isItemAllowed(::ItemStackBase const& item) const;
39
40 virtual bool isItemFiltered(::Recipes const& recipes, ::ItemStackBase const& item) const;
41
42 virtual int getBackgroundStyle(int slot, bool inventoryContainsItem) const;
43
44#ifdef LL_PLAT_S
45 virtual ::ItemSetType
46 _canSet(::ContainerScreenContext const&, int, ::ItemStackBase const&, ::ItemTransferAmount) const;
47#else // LL_PLAT_C
48 virtual ::ItemSetType _canSet(
50 int modelSlot,
51 ::ItemStackBase const& item,
52 ::ItemTransferAmount transferAmount
53 ) const;
54#endif
55
56#ifdef LL_PLAT_S
57 virtual int _getAvailableSetCount(::ContainerScreenContext const&, int, ::ItemStackBase const&) const;
58#else // LL_PLAT_C
59 virtual int
60 _getAvailableSetCount(::ContainerScreenContext const& context, int modelSlot, ::ItemStackBase const& item) const;
61#endif
62
63#ifdef LL_PLAT_S
64 virtual bool _canRemove(int, int) const;
65#else // LL_PLAT_C
66 virtual bool _canRemove(int modelSlot, int removeCount) const;
67#endif
68
69#ifdef LL_PLAT_S
70 virtual void _onItemChanged(int);
71#else // LL_PLAT_C
72 virtual void _onItemChanged(int modelSlot);
73#endif
74
75 // NOLINTEND
76
77public:
78 // member functions
79 // NOLINTBEGIN
80#ifdef LL_PLAT_C
81 MCAPI int _addItem(::ContainerScreenContext const& context, int modelSlot, int addCount);
82
83 MCAPI ::ItemAddType _canAdd(
85 int slot,
86 ::ItemStackBase const& item,
87 ::ItemTransferAmount transferAmount
88 ) const;
89
90 MCFOLD bool canConsume(int modelSlot, int removeCount) const;
91
92 MCFOLD bool canDestroy(int modelSlot, int removeCount) const;
93
94 MCFOLD bool canDrop(int modelSlot, int removeCount) const;
95
96 MCAPI ::ItemSetType canSet(
98 int modelSlot,
99 ::ItemStackBase const& item,
100 ::ItemTransferAmount transferAmount,
101 bool allowSwap
102 ) const;
103
104 MCAPI int
105 getAvailableAddCount(::ContainerScreenContext const& context, int modelSlot, ::ItemStackBase const& fillItem) const;
106
107 MCAPI int getAvailableAutoPlaceCount(
109 int slot,
110 ::ItemStackBase const& fillItem,
111 bool allowClobber
112 ) const;
113
114 MCAPI ::ItemStack const& getItemStack(int slot) const;
115
116 MCAPI ::ItemStack removeItem(int slot, int removeCount);
117
118 MCAPI bool setItem(
120 int slot,
121 ::ItemStack& stack,
122 ::ItemPlaceType type,
123 bool allowSwap
124 );
125#endif
126 // NOLINTEND
127
128public:
129 // virtual function thunks
130 // NOLINTBEGIN
131#ifdef LL_PLAT_C
132 MCFOLD ::ItemInstance const& $getRecipeItem(int index) const;
133
134 MCAPI bool $canRemove(int slot, int removeCount) const;
135
136 MCFOLD bool $isItemAllowed(::ItemStackBase const& item) const;
137
138 MCAPI bool $isItemFiltered(::Recipes const& recipes, ::ItemStackBase const& item) const;
139
140 MCFOLD int $getBackgroundStyle(int slot, bool inventoryContainsItem) const;
141
142 MCAPI ::ItemSetType $_canSet(
144 int modelSlot,
145 ::ItemStackBase const& item,
146 ::ItemTransferAmount transferAmount
147 ) const;
148
149 MCAPI int
150 $_getAvailableSetCount(::ContainerScreenContext const& context, int modelSlot, ::ItemStackBase const& item) const;
151
152 MCAPI bool $_canRemove(int modelSlot, int removeCount) const;
153
154 MCFOLD void $_onItemChanged(int modelSlot);
155#endif
156
157
158 // NOLINTEND
159
160public:
161 // vftables
162 // NOLINTBEGIN
163 MCNAPI static void** $vftable();
164 // NOLINTEND
165};
Definition ContainerController.h:21
static MCAPI void ** $vftable()
Definition ContainerModel.h:24
Definition ContainerScreenContext.h:16
Definition ItemInstance.h:15
Definition ItemStackBase.h:44
Definition ItemStack.h:26
Definition Recipes.h:37
Definition ItemTransferAmount.h:5
Definition context.h:5