LeviLamina
Loading...
Searching...
No Matches
ContainerAPI.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/client/gui/gameplay/api/gameplayui/AnvilInfo.h"
7#include "mc/client/gui/gameplay/api/gameplayui/QueryConnector.h"
8#include "mc/client/gui/gameplay/data/gameplayui/ChestType.h"
9#include "mc/deps/core/utility/pub_sub/Publisher.h"
10#include "mc/deps/shared_types/legacy/ContainerType.h"
11#include "mc/legacy/ActorUniqueID.h"
12#include "mc/world/containers/ContainerEnumName.h"
13#include "mc/world/containers/SlotData.h"
14#include "mc/world/containers/controllers/ItemCraftType.h"
15#include "mc/world/item/ItemGroup.h"
16#include "mc/world/level/BlockPos.h"
17
18// auto generated forward declare list
19// clang-format off
24class ContainerModel;
31class ItemRegistryRef;
32class ItemStackBase;
33class LocalPlayer;
35namespace Bedrock::PubSub::ThreadModel { struct SingleThreaded; }
36namespace GameplayUI { struct ContainerItem; }
37namespace GameplayUI { struct TradeOfferInfo; }
38namespace GameplayUI { struct TradeOverview; }
39namespace GameplayUI { struct TradeTierInfo; }
40// clang-format on
41
42namespace GameplayUI {
43
44class ContainerAPI {
45public:
46 // ContainerAPI inner types declare
47 // clang-format off
48 struct SplitMultipleState;
49 struct SplitSingleState;
50 // clang-format on
51
52 // ContainerAPI inner types define
53 struct SplitMultipleState {
54 public:
55 // member variables
56 // NOLINTBEGIN
57 ::ll::TypedStorage<8, 136, ::ItemGroup> distributionSource;
58 ::ll::TypedStorage<8, 40, ::SlotData> lastPlaceAllSlot;
59 ::ll::TypedStorage<4, 4, int> lastPlaceAllAmount;
60 // NOLINTEND
61 };
62
63 struct SplitSingleState {
64 public:
65 // member variables
66 // NOLINTBEGIN
67 ::ll::TypedStorage<8, 40, ::SlotData> lastPlaceOneSelectedSlot;
68 ::ll::TypedStorage<8, 40, ::SlotData> lastPlaceOneDestinationSlot;
69 // NOLINTEND
70 };
71
72public:
73 // member variables
74 // NOLINTBEGIN
75 ::ll::TypedStorage<8, 8, ::LocalPlayer*> mLocalPlayer;
76 ::ll::TypedStorage<8, 64, ::std::function<::ItemRegistryRef()>> mGetItemRegistryRef;
77 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ContainerManagerController>> mContainerManagerController;
78 ::ll::TypedStorage<8, 16, ::std::weak_ptr<::AnvilContainerManagerModel>> mAnvilContainerManagerModel;
79 ::ll::TypedStorage<8, 16, ::std::weak_ptr<::BrewingStandContainerManagerModel>> mBrewingStandContainerManagerModel;
80 ::ll::TypedStorage<8, 16, ::std::weak_ptr<::ChestContainerManagerModel>> mChestContainerManagerModel;
81 ::ll::TypedStorage<8, 16, ::std::weak_ptr<::CraftingContainerManagerModel>> mCraftingContainerManagerModel;
82 ::ll::TypedStorage<8, 16, ::std::weak_ptr<::FurnaceContainerManagerModel>> mFurnaceContainerManagerModel;
83 ::ll::TypedStorage<8, 16, ::std::weak_ptr<::GrindstoneContainerManagerModel>> mGrindstoneContainerManagerModel;
84 ::ll::TypedStorage<8, 16, ::std::weak_ptr<::HopperContainerManagerModel>> mHopperContainerManagerModel;
85 ::ll::TypedStorage<8, 16, ::std::weak_ptr<::DropperContainerManagerModel>> mDropperContainerManagerModel;
86 ::ll::TypedStorage<8, 16, ::std::weak_ptr<::DispenserContainerManagerModel>> mDispenserContainerManagerModel;
87 ::ll::TypedStorage<8, 16, ::std::weak_ptr<::Trade2ContainerManagerModel>> mTrade2ContainerManagerModel;
88 ::ll::TypedStorage<4, 12, ::BlockPos> mContainerBlockPos;
89 ::ll::TypedStorage<8, 8, ::ActorUniqueID> mUniqueActorId;
90 ::ll::TypedStorage<8, 80, ::GameplayUI::AnvilInfo> mAnvilInfo;
91 ::ll::TypedStorage<
92 8,
93 48,
94 ::Bedrock::PubSub::Publisher<void(::ItemStackBase const&), ::Bedrock::PubSub::ThreadModel::SingleThreaded, 0>>
95 mPreviewItemPublisher;
96 ::ll::TypedStorage<
97 8,
98 48,
99 ::Bedrock::PubSub::Publisher<void(::std::string const&), ::Bedrock::PubSub::ThreadModel::SingleThreaded, 0>>
100 mRecipeBookSearchPublisher;
101 ::ll::
102 TypedStorage<8, 48, ::Bedrock::PubSub::Publisher<void(bool), ::Bedrock::PubSub::ThreadModel::SingleThreaded, 0>>
103 mRecipeBookIsFilteringPublisher;
104 ::ll::TypedStorage<8, 184, ::GameplayUI::ContainerAPI::SplitMultipleState> mSplitMultipleState;
105 ::ll::TypedStorage<8, 88, ::std::optional<::GameplayUI::ContainerAPI::SplitSingleState>> mSplitSingleState;
106 // NOLINTEND
107
108public:
109 // prevent constructor by default
110 ContainerAPI();
111
112public:
113 // member functions
114 // NOLINTBEGIN
115 MCAPI explicit ContainerAPI(::std::function<::ItemRegistryRef()> getItemRegistryRef);
116
117 MCAPI void _recipeAutoCraft(::ContainerEnumName collectionName, int collectionIndex, ::ItemCraftType craftType);
118
119 MCAPI ::std::shared_ptr<::ContainerModel> _tryGetContainerModel(::ContainerEnumName containerName);
120
121 MCAPI void autoPlaceItems(::ContainerEnumName sourceName, int sourceIndex);
122
123 MCAPI void closeContainer();
124
125 MCAPI void coalesceItems(::ContainerEnumName destinationName, int destinationIndex, ::ContainerEnumName sourceName);
126
127 MCAPI void coalesceOrAutoPlaceItems(::ContainerEnumName destinationName, int destinationIndex);
128
129 MCAPI void dropAllItems(::ContainerEnumName sourceName, int sourceIndex);
130
131 MCAPI void dropOneItem(::ContainerEnumName sourceName, int sourceIndex);
132
133 MCAPI ::std::optional<::GameplayUI::AnvilInfo> getAnvilInfo();
134
135 MCAPI ::GameplayUI::ContainerItem getCraftingScreenContainerItem(::ContainerEnumName containerName, int index);
136
137 MCAPI ::GameplayUI::TradeOfferInfo getTradeOfferInfo(int tradeTier, int tradeIndex);
138
139 MCAPI ::GameplayUI::TradeOverview getTradeOverview();
140
141 MCAPI ::GameplayUI::ContainerItem getTradeScreenResultPreviewContainerItem(int index);
142
143 MCAPI ::GameplayUI::TradeTierInfo getTradeTierInfo(int tradeTier);
144
145 MCAPI void onPlayerOpenContainer(
146 ::SharedTypes::Legacy::ContainerType containerType,
147 ::BlockPos const& blockPos,
148 ::ActorUniqueID const& uniqueId
149 );
150
151 MCAPI void placeAllItems(
152 ::ContainerEnumName selectedName,
153 int selectedIndex,
154 ::ContainerEnumName destinationName,
155 int destinationIndex
156 );
157
158 MCAPI void placeAmountOfItems(
159 ::ContainerEnumName selectedName,
160 int selectedIndex,
161 ::ContainerEnumName destinationName,
162 int destinationIndex,
163 int amount
164 );
165
166 MCAPI void placeOneItem(
167 ::ContainerEnumName selectedName,
168 int selectedIndex,
169 ::ContainerEnumName destinationName,
170 int destinationIndex
171 );
172
173 MCAPI ::GameplayUI::QueryConnector<::GameplayUI::ContainerItem>
174 queryContainerItem(::ContainerEnumName containerName, int index);
175
176 MCAPI ::GameplayUI::QueryConnector<::std::string> queryContainerName();
177
178 MCAPI ::GameplayUI::QueryConnector<::std::string> queryRecipeBookSearchString();
179
180 MCAPI void selectRecipe(::ContainerEnumName sourceName, int sourceIndex, bool displayOnly);
181
182 MCAPI void setAnvilPreviewItemName(::std::string const& name);
183
184 MCAPI void setDistributeAllSource(::ContainerEnumName sourceName, int sourceIndex);
185
186 MCAPI void setRecipeBookFiltering(bool isFiltering);
187
188 MCAPI void setRecipeBookSearchString(::std::string const& searchText);
189
190 MCAPI void splitMultipleItems(
191 ::ContainerEnumName selectedName,
192 int selectedIndex,
193 ::ContainerEnumName destinationName,
194 int destinationIndex
195 );
196
197 MCAPI void splitMultipleItemsTouch(
198 ::ContainerEnumName selectedName,
199 int selectedIndex,
200 ::ContainerEnumName destinationName,
201 int destinationIndex
202 );
203
204 MCAPI void splitSingleItem(
205 ::ContainerEnumName sourceName,
206 int sourceIndex,
207 ::ContainerEnumName destinationName,
208 int destinationIndex
209 );
210
211 MCAPI void takeAllItems(
212 ::ContainerEnumName destinationName,
213 int destinationIndex,
214 ::ContainerEnumName sourceName,
215 int sourceIndex
216 );
217
218 MCAPI void takeHalfItems(
219 ::ContainerEnumName destinationName,
220 int destinationIndex,
221 ::ContainerEnumName sourceName,
222 int sourceIndex
223 );
224
225 MCAPI void takeOneItem(
226 ::ContainerEnumName destinationName,
227 int destinationIndex,
228 ::ContainerEnumName sourceName,
229 int sourceIndex
230 );
231
232 MCAPI ::std::optional<::GameplayUI::ChestType> tryGetChestType();
233
234 MCAPI ~ContainerAPI();
235 // NOLINTEND
236
237public:
238 // constructor thunks
239 // NOLINTBEGIN
240 MCAPI void* $ctor(::std::function<::ItemRegistryRef()> getItemRegistryRef);
241 // NOLINTEND
242
243public:
244 // destructor thunk
245 // NOLINTBEGIN
246 MCAPI void $dtor();
247 // NOLINTEND
248};
249
250} // namespace GameplayUI
Definition AnvilContainerManagerModel.h:18
Definition BrewingStandContainerManagerModel.h:19
Definition ChestContainerManagerModel.h:19
Definition ContainerManagerController.h:47
Definition ContainerModel.h:27
Definition CraftingContainerManagerModel.h:25
Definition DispenserContainerManagerModel.h:16
Definition DropperContainerManagerModel.h:16
Definition FurnaceContainerManagerModel.h:29
Definition ContainerAPI.h:7
Definition GrindstoneContainerManagerModel.h:18
Definition HopperContainerManagerModel.h:17
Definition ItemRegistryRef.h:36
Definition ItemStackBase.h:44
Definition LocalPlayer.h:5
Definition Trade2ContainerManagerModel.h:18
Definition ContainerAPI.h:18
Definition ContainerItem.h:7
Definition TradeOfferInfo.h:7
Definition TradeOverview.h:7
Definition TradeTierInfo.h:7