Skip to content
LeviMC
English
AutoLightDark
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/RecipeBookTab.h"
8#include "mc/client/gui/gameplay/data/gameplayui/ChestType.h"
9#include "mc/client/gui/gameplay/data/gameplayui/ContainerColorMode.h"
10#include "mc/client/gui/gameplay/data/gameplayui/ContainerInteractionsHandler.h"
11#include "mc/client/gui/gameplay/data/gameplayui/ContainerItemType.h"
12#include "mc/client/gui/gameplay/data/gameplayui/ContainerSlot.h"
13#include "mc/client/gui/oreui/input/GamepadButton.h"
14#include "mc/client/gui/oreui/input/MouseButton.h"
15#include "mc/deps/core/utility/NonOwnerPointer.h"
16#include "mc/deps/shared_types/legacy/ContainerType.h"
17#include "mc/deps/shared_types/legacy/LevelSoundEvent.h"
18#include "mc/legacy/ActorUniqueID.h"
19#include "mc/world/containers/ContainerEnumName.h"
20#include "mc/world/containers/controllers/ItemCraftType.h"
21#include "mc/world/item/ItemInstance.h"
22#include "mc/world/level/BlockPos.h"
23
24// auto generated forward declare list
25// clang-format off
30class ContainerModel;
37class GuiData;
39class ItemRegistryRef;
40class ItemStackBase;
41class LocalPlayer;
43namespace GameplayUI { struct BrewingStandInfo; }
44namespace GameplayUI { struct ContainerAction; }
45namespace GameplayUI { struct ContainerInputLegendEntry; }
46namespace GameplayUI { struct ContainerInteractionsContext; }
47namespace GameplayUI { struct ContainerItem; }
48namespace GameplayUI { struct FurnaceInfo; }
49namespace GameplayUI { struct RecipeBookTabData; }
50namespace GameplayUI { struct TradeOfferInfo; }
51namespace GameplayUI { struct TradeOverview; }
52namespace GameplayUI { struct TradeTierInfo; }
53// clang-format on
54
55namespace GameplayUI {
56
57class ContainerAPI {
58public:
59 // member variables
60 // NOLINTBEGIN
61 ::ll::TypedStorage<8, 8, ::LocalPlayer*> mLocalPlayer;
62 ::ll::TypedStorage<8, 64, ::std::function<::ItemRegistryRef()>> mGetItemRegistryRef;
63 ::ll::TypedStorage<8, 24, ::Bedrock::NotNullNonOwnerPtr<::GuiData>> mGuiData;
64 ::ll::TypedStorage<4, 76, ::GameplayUI::ContainerInteractionsHandler> mInteractionsHandler;
65 ::ll::TypedStorage<8, 128, ::ItemInstance> mSplitMultipleItemTemplate;
66 ::ll::TypedStorage<4, 4, int> mLastPlaceAllAmount;
67 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ContainerManagerController>> mContainerManagerController;
68 ::ll::TypedStorage<8, 16, ::std::weak_ptr<::AnvilContainerManagerModel>> mAnvilContainerManagerModel;
69 ::ll::TypedStorage<8, 16, ::std::weak_ptr<::BrewingStandContainerManagerModel>> mBrewingStandContainerManagerModel;
70 ::ll::TypedStorage<8, 16, ::std::weak_ptr<::ChestContainerManagerModel>> mChestContainerManagerModel;
71 ::ll::TypedStorage<8, 16, ::std::weak_ptr<::CraftingContainerManagerModel>> mCraftingContainerManagerModel;
72 ::ll::TypedStorage<8, 16, ::std::weak_ptr<::FurnaceContainerManagerModel>> mFurnaceContainerManagerModel;
73 ::ll::TypedStorage<8, 16, ::std::weak_ptr<::GrindstoneContainerManagerModel>> mGrindstoneContainerManagerModel;
74 ::ll::TypedStorage<8, 16, ::std::weak_ptr<::HopperContainerManagerModel>> mHopperContainerManagerModel;
75 ::ll::TypedStorage<8, 16, ::std::weak_ptr<::DropperContainerManagerModel>> mDropperContainerManagerModel;
76 ::ll::TypedStorage<8, 16, ::std::weak_ptr<::DispenserContainerManagerModel>> mDispenserContainerManagerModel;
77 ::ll::TypedStorage<8, 16, ::std::weak_ptr<::Trade2ContainerManagerModel>> mTrade2ContainerManagerModel;
78 ::ll::TypedStorage<4, 12, ::BlockPos> mContainerBlockPos;
79 ::ll::TypedStorage<8, 8, ::ActorUniqueID> mUniqueActorId;
80 ::ll::TypedStorage<8, 112, ::GameplayUI::AnvilInfo> mAnvilInfo;
81 ::ll::TypedStorage<8, 24, ::std::vector<::GameplayUI::ContainerInputLegendEntry>> mInputLegend;
82 ::ll::TypedStorage<4, 12, ::std::optional<::GameplayUI::ContainerSlot>> mFocusedContainerSlot;
83 // NOLINTEND
84
85public:
86 // member functions
87 // NOLINTBEGIN
88 MCNAPI ::GameplayUI::ContainerItem
89 _containerItemFromItemStack(::ItemStackBase const& item, ::GameplayUI::ContainerItemType containerItemType) const;
90
92
93 MCNAPI ::GameplayUI::ContainerInteractionsContext
94 _getInteractionsContext(::ContainerEnumName container, int slot, bool isDoubleClick, bool isShiftClick) const;
95
96 MCNAPI void _playSound(::SharedTypes::Legacy::LevelSoundEvent eventName) const;
97
98 MCNAPI void _playSound(::std::string const& soundName) const;
99
100 MCNAPI void _recipeAutoCraft(::ContainerEnumName collectionName, int collectionIndex, ::ItemCraftType craftType);
101
102 MCNAPI void _refreshInputLegend();
103
105 ::std::unordered_map<::std::string, ::std::shared_ptr<::ContainerModel>> const& containers
106 );
107
108 MCNAPI ::std::shared_ptr<::ContainerModel> _tryGetContainerModel(::ContainerEnumName containerName) const;
109
110 MCNAPI ::CraftingContainerManagerController* _tryGetCraftingContainerManagerController() const;
111
113
114 MCNAPI void closeContainer();
115
116 MCNAPI ::std::vector<::GameplayUI::RecipeBookTab> getActiveRecipeBookTabs() const;
117
118 MCNAPI ::std::optional<::GameplayUI::AnvilInfo> getAnvilInfo() const;
119
120 MCNAPI ::std::vector<::GameplayUI::RecipeBookTabData> getAvailableRecipeBookTabs() const;
121
122 MCNAPI ::std::optional<::GameplayUI::BrewingStandInfo> getBrewingStandInfo() const;
123
124 MCNAPI ::std::vector<::GameplayUI::ContainerItem> getBundleContent(int bundleID) const;
125
126 MCNAPI ::std::optional<::GameplayUI::ChestType> getChestType() const;
127
128 MCNAPI ::std::optional<::GameplayUI::ContainerColorMode> getContainerColorMode();
129
130 MCNAPI ::std::optional<::GameplayUI::ContainerItem>
131 getContainerItem(::ContainerEnumName containerName, int index) const;
132
133 MCNAPI ::std::string getContainerName() const;
134
135 MCNAPI ::std::optional<::GameplayUI::ContainerItem> getFocusedBundle() const;
136
137 MCNAPI ::std::string getFocusedSlotTooltip() const;
138
139 MCNAPI ::std::optional<::GameplayUI::FurnaceInfo> getFurnaceInfo() const;
140
141 MCNAPI ::std::string getRecipeBookSearchString() const;
142
143 MCNAPI ::GameplayUI::ContainerItem getSelectedBundleItem() const;
144
145 MCNAPI ::GameplayUI::TradeOfferInfo getTradeOfferInfo(int tradeTier, int tradeIndex) const;
146
147 MCNAPI ::GameplayUI::TradeOverview getTradeOverview() const;
148
149 MCNAPI ::GameplayUI::TradeTierInfo getTradeTierInfo(int tradeTier) const;
150
151 MCNAPI void handleSlotGamepadDrag(::OreUI::GamepadButton button, ::ContainerEnumName container, int slot);
152
153 MCNAPI void handleSlotGamepadLongPress(::OreUI::GamepadButton button, ::ContainerEnumName container, int slot);
154
155 MCNAPI void
156 handleSlotGamepadPress(::OreUI::GamepadButton button, ::ContainerEnumName container, int slot, bool isDoubleClick);
157
158 MCNAPI void handleSlotMouseDrag(::OreUI::MouseButton button, ::ContainerEnumName container, int slot);
159
161 ::OreUI::MouseButton button,
162 ::ContainerEnumName container,
163 int slot,
164 bool isDoubleClick,
165 bool isShiftClick
166 );
167
168 MCNAPI void handleSlotMouseRelease(::OreUI::MouseButton button, ::ContainerEnumName container, int slot);
169
170 MCNAPI void handleSlotTouchDrag(::ContainerEnumName container, int slot);
171
172 MCNAPI void handleSlotTouchLongPressMove(::ContainerEnumName container, int slot, float normalizedValue);
173
174 MCNAPI void handleSlotTouchLongPressStart(::ContainerEnumName container, int slot);
175
176 MCNAPI void handleSlotTouchRelease(::ContainerEnumName container, int slot, bool isDoubleClick);
177
178 MCNAPI bool isRecipeBookAvailable() const;
179
181 ::SharedTypes::Legacy::ContainerType containerType,
182 ::BlockPos const& blockPos,
183 ::ActorUniqueID const& uniqueId
184 );
185
186 MCNAPI void performAutoTrade(int tradeTier, int tradeIndex);
187
189
190 MCNAPI void selectTrade(int tradeTier, int tradeIndex);
191
192 MCNAPI void setAnvilPreviewItemName(::std::string const& name);
193
194 MCNAPI void setRecipeBookFiltering(bool isFiltering);
195
196 MCNAPI void setRecipeBookSearchString(::std::string const& searchText);
197
198 MCNAPI void setRecipeBookVisibility(bool visible);
199
201 // NOLINTEND
202
203public:
204 // destructor thunk
205 // NOLINTBEGIN
206 MCNAPI void $dtor();
207 // NOLINTEND
208};
209
210} // namespace GameplayUI
Definition AnvilContainerManagerModel.h:16
Definition BlockPos.h:14
Definition BrewingStandContainerManagerModel.h:16
Definition ChestContainerManagerModel.h:15
Definition ContainerManagerController.h:46
Definition ContainerModel.h:23
Definition CraftingContainerManagerController.h:40
Definition CraftingContainerManagerModel.h:25
Definition DispenserContainerManagerModel.h:13
Definition DropperContainerManagerModel.h:13
Definition FurnaceContainerManagerModel.h:26
Definition ContainerAPI.h:7
MCAPI::GameplayUI::TradeOfferInfo getTradeOfferInfo(int tradeTier, int tradeIndex) const
MCAPI::GameplayUI::ContainerInteractionsContext _getInteractionsContext(::ContainerEnumName container, int slot, bool isDoubleClick, bool isShiftClick) const
MCAPI::GameplayUI::TradeOverview getTradeOverview() const
MCAPI::std::string getRecipeBookSearchString() const
MCAPI void performAutoTrade(int tradeTier, int tradeIndex)
MCAPI void _recipeAutoCraft(::ContainerEnumName collectionName, int collectionIndex, ::ItemCraftType craftType)
MCAPI ::std::vector<::GameplayUI::RecipeBookTabData > getAvailableRecipeBookTabs() const
MCAPI ::std::shared_ptr<::ContainerModel > _tryGetContainerModel(::ContainerEnumName containerName) const
MCAPI ::std::optional<::GameplayUI::AnvilInfo > getAnvilInfo() const
MCAPI void closeContainer()
MCAPI::GameplayUI::TradeTierInfo getTradeTierInfo(int tradeTier) const
MCAPI ::std::optional<::GameplayUI::ChestType > getChestType() const
MCAPI void handleSlotGamepadLongPress(::OreUI::GamepadButton button, ::ContainerEnumName container, int slot)
MCAPI void handleSlotMouseRelease(::OreUI::MouseButton button, ::ContainerEnumName container, int slot)
MCAPI void _refreshInputLegend()
MCAPI void setRecipeBookFiltering(bool isFiltering)
MCAPI::GameplayUI::ContainerItem getSelectedBundleItem() const
MCAPI void setAnvilPreviewItemName(::std::string const &name)
MCAPI void handleSlotTouchLongPressMove(::ContainerEnumName container, int slot, float normalizedValue)
MCAPI void _tryUpdateCraftingContainer()
MCAPI::std::string getFocusedSlotTooltip() const
MCAPI void _playSound(::SharedTypes::Legacy::LevelSoundEvent eventName) const
MCAPI void _doContainerAction(::GameplayUI::ContainerAction const &action)
MCAPI void _playSound(::std::string const &soundName) const
MCAPI void handleSlotTouchDrag(::ContainerEnumName container, int slot)
MCAPI bool isRecipeBookAvailable() const
MCAPI ::std::optional<::GameplayUI::BrewingStandInfo > getBrewingStandInfo() const
MCAPI::std::string getContainerName() const
MCAPI void onPlayerOpenContainer(::SharedTypes::Legacy::ContainerType containerType, ::BlockPos const &blockPos, ::ActorUniqueID const &uniqueId)
MCAPI void handleSlotMousePress(::OreUI::MouseButton button, ::ContainerEnumName container, int slot, bool isDoubleClick, bool isShiftClick)
MCAPI void setRecipeBookVisibility(bool visible)
MCAPI void handleSlotTouchLongPressStart(::ContainerEnumName container, int slot)
MCAPI void handleSlotTouchRelease(::ContainerEnumName container, int slot, bool isDoubleClick)
MCAPI ::std::optional<::GameplayUI::ContainerItem > getFocusedBundle() const
MCAPI void handleSlotGamepadPress(::OreUI::GamepadButton button, ::ContainerEnumName container, int slot, bool isDoubleClick)
MCAPI::CraftingContainerManagerController * _tryGetCraftingContainerManagerController() const
MCAPI void _resetSelectedRecipeTabIfEmpty(::std::unordered_map<::std::string, ::std::shared_ptr<::ContainerModel > > const &containers)
MCAPI ::std::vector<::GameplayUI::RecipeBookTab > getActiveRecipeBookTabs() const
MCAPI void selectTrade(int tradeTier, int tradeIndex)
MCAPI ::std::optional<::GameplayUI::ContainerColorMode > getContainerColorMode()
MCAPI void handleSlotMouseDrag(::OreUI::MouseButton button, ::ContainerEnumName container, int slot)
MCAPI void setRecipeBookSearchString(::std::string const &searchText)
MCAPI::GameplayUI::ContainerItem _containerItemFromItemStack(::ItemStackBase const &item, ::GameplayUI::ContainerItemType containerItemType) const
MCAPI ::std::vector<::GameplayUI::ContainerItem > getBundleContent(int bundleID) const
MCAPI void handleSlotGamepadDrag(::OreUI::GamepadButton button, ::ContainerEnumName container, int slot)
MCAPI ::std::optional<::GameplayUI::FurnaceInfo > getFurnaceInfo() const
MCAPI ::std::optional<::GameplayUI::ContainerItem > getContainerItem(::ContainerEnumName containerName, int index) const
MCAPI void pullInIngredientsForSelectedTrade()
Definition GrindstoneContainerManagerModel.h:15
Definition GuiData.h:5
Definition HopperContainerManagerModel.h:13
Definition ItemRegistryRef.h:36
Definition ItemStackBase.h:45
Definition LocalPlayer.h:5
Definition Trade2ContainerManagerModel.h:17
Definition ActorUniqueID.h:5
Definition BrewingStandInfo.h:7
Definition ContainerAction.h:7
Definition ContainerInputLegendEntry.h:7
Definition ContainerInteractionsContext.h:7
Definition ContainerItem.h:7
Definition FurnaceInfo.h:7
Definition RecipeBookTabData.h:7
Definition TradeOfferInfo.h:7
Definition TradeOverview.h:7
Definition TradeTierInfo.h:7