LeviLamina
Loading...
Searching...
No Matches
CraftingContainerManagerModel.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/world/ContainerID.h"
7#include "mc/world/containers/ContainerEnumName.h"
8#include "mc/world/containers/managers/models/ContainerManagerModel.h"
9#include "mc/world/containers/models/FilterResult.h"
10#include "mc/world/containers/models/TextSearchMode.h"
11#include "mc/world/item/ItemInstance.h"
12#include "mc/world/item/crafting/RecipeIngredientSet.h"
13#include "mc/world/level/BlockPos.h"
14
15// auto generated forward declare list
16// clang-format off
17class ContainerModel;
21class ItemStack;
22class Player;
23// clang-format on
24
25class CraftingContainerManagerModel : public ::ContainerManagerModel {
26public:
27 // CraftingContainerManagerModel inner types define
28 using FilterFunction = ::std::function<::FilterResult(::ItemInstance const&, bool)>;
29
30public:
31 // member variables
32 // NOLINTBEGIN
33 ::ll::TypedStorage<4, 12, ::BlockPos> mBlockPos;
34 ::ll::TypedStorage<1, 1, bool> mWorkbench;
35 ::ll::TypedStorage<1, 1, bool> mPocket;
36 ::ll::TypedStorage<1, 1, bool> mCraftableFilterOn;
37 ::ll::TypedStorage<8, 32, ::std::string> mSearchString;
38 ::ll::TypedStorage<8, 32, ::std::string> mCaseFoldedSearchString;
39 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::ContainerModel>> mInventoryContainerModel;
40 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::ContainerModel>> mCraftingInputContainerModel;
41 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::ContainerModel>> mHotbarContainerModel;
42 ::ll::TypedStorage<8, 64, ::RecipeIngredientSet> mIngredientSet;
43 ::ll::TypedStorage<8, 128, ::ItemInstance> mLastCraftedItem;
44 ::ll::TypedStorage<4, 4, int> mContainerPopulationTabIndex;
45 ::ll::TypedStorage<8, 8, uint64> mContainerPopulationGroupIndex;
46 ::ll::TypedStorage<8, 8, uint64> mContainerPopulationGroupItemIndex;
47 ::ll::TypedStorage<8, 8, uint64> mContainerPopulationItemIndex;
48 ::ll::TypedStorage<8, 8, uint64> mContainerPopulationTotalItemCount;
49 // NOLINTEND
50
51#ifdef LL_PLAT_S
52#else // LL_PLAT_C
53public:
54 // prevent constructor by default
55 CraftingContainerManagerModel();
56
57#endif
58public:
59 // virtual functions
60 // NOLINTBEGIN
61#ifdef LL_PLAT_S
62 virtual ~CraftingContainerManagerModel() /*override*/ = default;
63#else // LL_PLAT_C
64 virtual ~CraftingContainerManagerModel() /*override*/;
65#endif
66
67 virtual ::std::vector<::ItemStack> getItemCopies() const /*override*/;
68
69 virtual void setSlot(int, ::ItemStack const&, bool) /*override*/;
70
71 virtual ::ItemStack const& getSlot(int) const /*override*/;
72
73 virtual void setData(int, int) /*override*/;
74
75 virtual void broadcastChanges() /*override*/;
76
77 virtual bool isValid(float pickRange) /*override*/;
78
79 virtual bool tick() /*override*/;
80
81 virtual ::ContainerScreenContext _postInit() /*override*/;
82 // NOLINTEND
83
84public:
85 // member functions
86 // NOLINTBEGIN
87#ifdef LL_PLAT_C
88 MCAPI CraftingContainerManagerModel(
89 ::ContainerID containerId,
90 ::Player& player,
91 bool workbench,
92 bool pocket,
93 bool craftableFilterOn,
94 ::BlockPos const& pos,
95 ::std::string const& inventorySearch
96 );
97
98 MCAPI ::std::shared_ptr<::FilteredContainerModel> _createContainerModel(
99 ::ContainerEnumName containerEnumName,
100 ::CreativeItemGroupCategory* const category,
101 bool doExpando,
102 ::std::function<::FilterResult(::ItemInstance const&, bool)> rule
103 );
104
105 MCAPI ::std::shared_ptr<::FilteredContainerModel> _createContainerModel(
106 ::ContainerEnumName containerEnumName,
107 ::std::vector<::ItemInstance> const& itemInstanceVector,
108 bool doExpando,
109 ::std::function<::FilterResult(::ItemInstance const&, bool)> rule
110 );
111
112 MCAPI ::FilterResult _filterByInventory(::ItemInstance const& item, bool includeCursorItem) const;
113
114 MCAPI ::FilterResult _filterByText(::ItemInstance const& item, ::TextSearchMode searchMode) const;
115
116 MCAPI bool _foundInStartOfAnyWord(::std::string const& itemName) const;
117
118 MCAPI bool _hasUnlockedRecipes(::ItemInstance const& item) const;
119
120 MCAPI bool _populateContainers(uint64& count);
121
122 MCFOLD void fireItemAcquiredEvent(::ItemInstance const& itemInstance, int count);
123
124 MCAPI ::std::vector<::std::string> const getCraftingTags() const;
125
126 MCAPI bool hasIngredientSetChanged(::ItemStack const& inHand);
127
128 MCAPI void setIsFiltering(bool craftableFilterOn);
129
130 MCAPI void setSearchString(::std::string const& searchString);
131#endif
132 // NOLINTEND
133
134public:
135 // constructor thunks
136 // NOLINTBEGIN
137#ifdef LL_PLAT_C
138 MCAPI void* $ctor(
139 ::ContainerID containerId,
140 ::Player& player,
141 bool workbench,
142 bool pocket,
143 bool craftableFilterOn,
144 ::BlockPos const& pos,
145 ::std::string const& inventorySearch
146 );
147#endif
148 // NOLINTEND
149
150public:
151 // destructor thunk
152 // NOLINTBEGIN
153 MCAPI void $dtor();
154 // NOLINTEND
155
156public:
157 // virtual function thunks
158 // NOLINTBEGIN
159#ifdef LL_PLAT_C
160 MCFOLD ::std::vector<::ItemStack> $getItemCopies() const;
161
162 MCFOLD void $setSlot(int, ::ItemStack const&, bool);
163
164 MCFOLD ::ItemStack const& $getSlot(int) const;
165
166 MCFOLD void $setData(int, int);
167
168 MCFOLD void $broadcastChanges();
169
170 MCAPI bool $isValid(float pickRange);
171
172 MCAPI bool $tick();
173
174 MCAPI ::ContainerScreenContext $_postInit();
175#endif
176
177
178 // NOLINTEND
179
180public:
181 // vftables
182 // NOLINTBEGIN
183 MCNAPI static void** $vftable();
184 // NOLINTEND
185};
Definition BlockPos.h:19
Definition ContainerModel.h:27
Definition ContainerScreenContext.h:17
static MCAPI void ** $vftable()
Definition CreativeItemGroupCategory.h:17
Definition FilteredContainerModel.h:19
Definition ItemInstance.h:15
Definition ItemStack.h:26
Definition Player.h:129