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/data/gameplayui/ChestType.h"
8#include "mc/client/gui/gameplay/data/gameplayui/ContainerColorMode.h"
9#include "mc/client/gui/gameplay/data/gameplayui/ContainerInteractionsHandler.h"
10#include "mc/client/gui/gameplay/data/gameplayui/ContainerItemType.h"
11#include "mc/deps/shared_types/legacy/ContainerType.h"
12#include "mc/deps/shared_types/legacy/LevelSoundEvent.h"
13#include "mc/legacy/ActorUniqueID.h"
14#include "mc/world/containers/ContainerEnumName.h"
15#include "mc/world/containers/SlotData.h"
16#include "mc/world/containers/controllers/ItemCraftType.h"
17#include "mc/world/item/ItemGroup.h"
18#include "mc/world/item/ItemInstance.h"
19#include "mc/world/level/BlockPos.h"
20
21// auto generated forward declare list
22// clang-format off
27class ContainerModel;
34class ItemRegistryRef;
35class ItemStackBase;
36class LocalPlayer;
38namespace GameplayUI { struct BrewingStandInfo; }
39namespace GameplayUI { struct ContainerAction; }
40namespace GameplayUI { struct ContainerInteractionsContext; }
41namespace GameplayUI { struct ContainerItem; }
42namespace GameplayUI { struct TradeOfferInfo; }
43namespace GameplayUI { struct TradeOverview; }
44namespace GameplayUI { struct TradeTierInfo; }
45// clang-format on
46
47namespace GameplayUI {
48
49class ContainerAPI {
50public:
51 // ContainerAPI inner types declare
52 // clang-format off
53 struct SplitMultipleState;
54 struct SplitSingleState;
55 // clang-format on
56
57 // ContainerAPI inner types define
58 struct SplitMultipleState {
59 public:
60 // member variables
61 // NOLINTBEGIN
62 ::ll::TypedStorage<8, 136, ::ItemGroup> distributionSource;
63 ::ll::TypedStorage<8, 40, ::SlotData> lastPlaceAllSlot;
64 ::ll::TypedStorage<4, 4, int> lastPlaceAllAmount;
65 // NOLINTEND
66 };
67
68 struct SplitSingleState {
69 public:
70 // member variables
71 // NOLINTBEGIN
72 ::ll::TypedStorage<8, 40, ::SlotData> lastPlaceOneSelectedSlot;
73 ::ll::TypedStorage<8, 40, ::SlotData> lastPlaceOneDestinationSlot;
74 // NOLINTEND
75 };
76
77public:
78 // member variables
79 // NOLINTBEGIN
80 ::ll::TypedStorage<8, 8, ::LocalPlayer*> mLocalPlayer;
81 ::ll::TypedStorage<8, 64, ::std::function<::ItemRegistryRef()>> mGetItemRegistryRef;
82 ::ll::TypedStorage<4, 12, ::GameplayUI::ContainerInteractionsHandler> mInteractionsHandler;
83 ::ll::TypedStorage<8, 128, ::ItemInstance> mSplitMultipleItemTemplate;
84 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ContainerManagerController>> mContainerManagerController;
85 ::ll::TypedStorage<8, 16, ::std::weak_ptr<::AnvilContainerManagerModel>> mAnvilContainerManagerModel;
86 ::ll::TypedStorage<8, 16, ::std::weak_ptr<::BrewingStandContainerManagerModel>> mBrewingStandContainerManagerModel;
87 ::ll::TypedStorage<8, 16, ::std::weak_ptr<::ChestContainerManagerModel>> mChestContainerManagerModel;
88 ::ll::TypedStorage<8, 16, ::std::weak_ptr<::CraftingContainerManagerModel>> mCraftingContainerManagerModel;
89 ::ll::TypedStorage<8, 16, ::std::weak_ptr<::FurnaceContainerManagerModel>> mFurnaceContainerManagerModel;
90 ::ll::TypedStorage<8, 16, ::std::weak_ptr<::GrindstoneContainerManagerModel>> mGrindstoneContainerManagerModel;
91 ::ll::TypedStorage<8, 16, ::std::weak_ptr<::HopperContainerManagerModel>> mHopperContainerManagerModel;
92 ::ll::TypedStorage<8, 16, ::std::weak_ptr<::DropperContainerManagerModel>> mDropperContainerManagerModel;
93 ::ll::TypedStorage<8, 16, ::std::weak_ptr<::DispenserContainerManagerModel>> mDispenserContainerManagerModel;
94 ::ll::TypedStorage<8, 16, ::std::weak_ptr<::Trade2ContainerManagerModel>> mTrade2ContainerManagerModel;
95 ::ll::TypedStorage<4, 12, ::BlockPos> mContainerBlockPos;
96 ::ll::TypedStorage<8, 8, ::ActorUniqueID> mUniqueActorId;
97 ::ll::TypedStorage<8, 112, ::GameplayUI::AnvilInfo> mAnvilInfo;
98 ::ll::TypedStorage<8, 184, ::GameplayUI::ContainerAPI::SplitMultipleState> mSplitMultipleState_DEPRECATED;
99 ::ll::TypedStorage<8, 88, ::std::optional<::GameplayUI::ContainerAPI::SplitSingleState>>
100 mSplitSingleState_DEPRECATED;
101 // NOLINTEND
102
103public:
104 // member functions
105 // NOLINTBEGIN
106 MCAPI ::GameplayUI::ContainerItem
107 _containerItemFromItemStack(::ItemStackBase const& item, ::GameplayUI::ContainerItemType containerItemType) const;
108
109 MCAPI void _doContainerAction(::GameplayUI::ContainerAction const& action);
110
111 MCAPI ::GameplayUI::ContainerInteractionsContext
112 _getInteractionsContext(::ContainerEnumName container, int slot, bool isDoubleClick, bool isShiftClick) const;
113
114 MCAPI void _playSound(::SharedTypes::Legacy::LevelSoundEvent eventName) const;
115
116 MCAPI void _playSound(::std::string const& soundName) const;
117
118 MCAPI void _recipeAutoCraft(::ContainerEnumName collectionName, int collectionIndex, ::ItemCraftType craftType);
119
120 MCAPI ::std::shared_ptr<::ContainerModel> _tryGetContainerModel(::ContainerEnumName containerName) const;
121
122 MCAPI void _tryUpdateCraftingContainer();
123
124 MCAPI void autoPlaceItems_DEPRECATED(::ContainerEnumName sourceName, int sourceIndex);
125
126 MCAPI void closeContainer();
127
128 MCAPI void coalesceItems(::ContainerEnumName destinationName, int destinationIndex, ::ContainerEnumName sourceName);
129
130 MCAPI void coalesceOrAutoPlaceItems_DEPRECATED(::ContainerEnumName destinationName, int destinationIndex);
131
132 MCAPI void dropAllItems_DEPRECATED(::ContainerEnumName sourceName, int sourceIndex);
133
134 MCAPI void dropOneItem_DEPRECATED(::ContainerEnumName sourceName, int sourceIndex);
135
136 MCAPI ::std::optional<::GameplayUI::AnvilInfo> getAnvilInfo() const;
137
138 MCAPI ::std::optional<::GameplayUI::BrewingStandInfo> getBrewingStandInfo() const;
139
140 MCAPI ::std::vector<::GameplayUI::ContainerItem> getBundleContent(int bundleID) const;
141
142 MCAPI ::std::optional<::GameplayUI::ChestType> getChestType() const;
143
144 MCAPI ::std::optional<::GameplayUI::ContainerColorMode> getContainerColorMode();
145
146 MCAPI ::std::optional<::GameplayUI::ContainerItem>
147 getContainerItem(::ContainerEnumName containerName, int index) const;
148
149 MCAPI ::std::string getContainerName() const;
150
151 MCAPI ::std::optional<::GameplayUI::ContainerItem>
152 getCraftingScreenContainerItem(::ContainerEnumName containerName, int index) const;
153
154 MCAPI ::std::string getRecipeBookSearchString() const;
155
156 MCAPI ::GameplayUI::TradeOfferInfo getTradeOfferInfo(int tradeTier, int tradeIndex) const;
157
158 MCAPI ::GameplayUI::TradeOverview getTradeOverview() const;
159
160 MCAPI ::GameplayUI::ContainerItem getTradeScreenResultPreviewContainerItem(int index) const;
161
162 MCAPI ::GameplayUI::TradeTierInfo getTradeTierInfo(int tradeTier) const;
163
164 MCAPI void handleSlotMouseDrag(int button, ::ContainerEnumName container, int slot);
165
166 MCAPI void
167 handleSlotMousePress(int button, ::ContainerEnumName container, int slot, bool isDoubleClick, bool isShiftClick);
168
169 MCAPI void handleSlotMouseRelease(int button, ::ContainerEnumName container, int slot);
170
171 MCAPI void onPlayerOpenContainer(
172 ::SharedTypes::Legacy::ContainerType containerType,
173 ::BlockPos const& blockPos,
174 ::ActorUniqueID const& uniqueId
175 );
176
177 MCAPI void performAutoTrade(int tradeTier, int tradeIndex);
178
179 MCAPI void placeAllItems_DEPRECATED(
180 ::ContainerEnumName selectedName,
181 int selectedIndex,
182 ::ContainerEnumName destinationName,
183 int destinationIndex
184 );
185
186 MCAPI void placeAmountOfItems_DEPRECATED(
187 ::ContainerEnumName selectedName,
188 int selectedIndex,
189 ::ContainerEnumName destinationName,
190 int destinationIndex,
191 int amount
192 );
193
194 MCAPI void placeOneItem_DEPRECATED(
195 ::ContainerEnumName selectedName,
196 int selectedIndex,
197 ::ContainerEnumName destinationName,
198 int destinationIndex
199 );
200
201 MCAPI void pullInIngredientsForSelectedTrade();
202
203 MCAPI void resetSplitStack_DEPRECATED();
204
205 MCAPI void selectTrade(int tradeTier, int tradeIndex);
206
207 MCAPI void setAnvilPreviewItemName(::std::string const& name);
208
209 MCAPI void setDistributeAllSource_DEPRECATED(::ContainerEnumName sourceName, int sourceIndex);
210
211 MCAPI void setRecipeBookFiltering(bool isFiltering);
212
213 MCAPI void setRecipeBookSearchString(::std::string const& searchText);
214
215 MCAPI void splitMultipleItemsTouch_DEPRECATED(
216 ::ContainerEnumName selectedName,
217 int selectedIndex,
218 ::ContainerEnumName destinationName,
219 int destinationIndex
220 );
221
222 MCAPI void splitMultipleItems_DEPRECATED(
223 ::ContainerEnumName selectedName,
224 int selectedIndex,
225 ::ContainerEnumName destinationName,
226 int destinationIndex
227 );
228
229 MCAPI void splitSingleItem_DEPRECATED(
230 ::ContainerEnumName sourceName,
231 int sourceIndex,
232 ::ContainerEnumName destinationName,
233 int destinationIndex
234 );
235
236 MCAPI void takeAllItems_DEPRECATED(
237 ::ContainerEnumName destinationName,
238 int destinationIndex,
239 ::ContainerEnumName sourceName,
240 int sourceIndex
241 );
242
243 MCAPI void takeHalfItems_DEPRECATED(
244 ::ContainerEnumName destinationName,
245 int destinationIndex,
246 ::ContainerEnumName sourceName,
247 int sourceIndex
248 );
249
250 MCAPI void takeOneItem_DEPRECATED(
251 ::ContainerEnumName destinationName,
252 int destinationIndex,
253 ::ContainerEnumName sourceName,
254 int sourceIndex
255 );
256
257 MCAPI ~ContainerAPI();
258 // NOLINTEND
259
260public:
261 // destructor thunk
262 // NOLINTBEGIN
263 MCAPI void $dtor();
264 // NOLINTEND
265};
266
267} // namespace GameplayUI
Definition AnvilContainerManagerModel.h:16
Definition BrewingStandContainerManagerModel.h:17
Definition ChestContainerManagerModel.h:19
Definition ContainerManagerController.h:46
Definition ContainerModel.h:24
Definition CraftingContainerManagerModel.h:25
Definition DispenserContainerManagerModel.h:16
Definition DropperContainerManagerModel.h:16
Definition FurnaceContainerManagerModel.h:27
Definition ContainerAPI.h:7
Definition GrindstoneContainerManagerModel.h:16
Definition HopperContainerManagerModel.h:17
Definition ItemRegistryRef.h:41
Definition ItemStackBase.h:44
Definition LocalPlayer.h:5
Definition Trade2ContainerManagerModel.h:17
Definition BrewingStandInfo.h:7
Definition ContainerAPI.h:18
Definition ContainerAction.h:7
Definition ContainerInteractionsContext.h:7
Definition ContainerItem.h:7
Definition TradeOfferInfo.h:7
Definition TradeOverview.h:7
Definition TradeTierInfo.h:7