40class CraftingContainerManagerController :
public ::ContainerManagerController {
59 BlockChangeListener& operator=(BlockChangeListener
const&);
60 BlockChangeListener(BlockChangeListener
const&);
61 BlockChangeListener();
66 virtual ~BlockChangeListener() =
default;
68 virtual void onBlockChanged(
76 ::BlockChangedEventTarget eventTarget,
87 MCNAPI
void $onBlockChanged(
95 ::BlockChangedEventTarget eventTarget,
109 ::ll::TypedStorage<8, 16, ::std::weak_ptr<::CraftingContainerManagerModel>> mCraftingContainerManagerModel;
110 ::ll::TypedStorage<4, 4, int> mGridSize;
111 ::ll::TypedStorage<8, 8, ::Recipes*> mLevelRecipes;
112 ::ll::TypedStorage<8, 24, ::std::vector<::std::reference_wrapper<::Recipe const>>> mRecipes;
113 ::ll::TypedStorage<8, 8, ::Recipe const*> mCraftingRecipe;
114 ::ll::TypedStorage<8, 8, ::Recipe const*> mSelectedRecipe;
115 ::ll::TypedStorage<1, 1, bool> mDisplayingInvalidRecipe;
116 ::ll::TypedStorage<1, 1, bool> mClearInputGridOnChange;
117 ::ll::TypedStorage<8, 40, ::SlotData const> mCreatedItemOutputSlot;
118 ::ll::TypedStorage<8, 24, ::std::vector<::ItemStateData>> mSavedInventoryState;
119 ::ll::TypedStorage<8, 48, ::CraftingSessionInfo> mCraftingInformation;
120 ::ll::TypedStorage<8, 24, ::std::vector<::ItemStack>> mRemainingItems;
121 ::ll::TypedStorage<8, 128, ::ItemInstance> mResultPreviewItem;
122 ::ll::TypedStorage<8, 24, ::std::vector<::ItemInstance>> mAllResults;
123 ::ll::TypedStorage<8, 16, ::std::shared_ptr<bool>> mListenerLifeIndicator;
124 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::CraftingContainerManagerController::BlockChangeListener>>
125 mBlockChangeListener;
126 ::ll::TypedStorage<8, 64, ::std::unordered_map<int, ::CraftableCountingData>> mCraftableCountCache;
127 ::ll::TypedStorage<1, 1, bool> mCraftableCountCacheDirty;
128 ::ll::TypedStorage<1, 1, bool> mCloseCraftingContainer;
129 ::ll::TypedStorage<1, 1, bool> mIsCrafting;
136 CraftingContainerManagerController();
142 virtual ~CraftingContainerManagerController() =
default;
144 virtual bool isOutputSlot(::std::string
const& collectionName)
const ;
146 virtual bool handleTakeAmount(
::SlotData const& dstSlot,
int amount,
::SlotData const& srcSlot) ;
156 virtual int handleAutoPlace(
159 ::std::vector<::AutoPlaceItem>
const& autoPlaceOrder,
160 ::std::vector<::AutoPlaceResult>& destinations
163 virtual int handleAutoPlaceStack(
166 ::std::vector<::AutoPlaceItem>
const& autoPlaceOrder,
167 ::std::vector<::AutoPlaceResult>& destinations
172 virtual void handleSplitMultiple(
183 virtual void closeContainers() ;
185 virtual ::ItemStackBase
const& getTakeableItemStackBase(
::SlotData const& slot)
const ;
192 MCNAPI
explicit CraftingContainerManagerController(
193 ::std::weak_ptr<::CraftingContainerManagerModel> containerManagerModel
196 MCNAPI
void _filterRecipes();
198 MCNAPI ::std::vector<::RecipeSearchResult> _getRecipesForItem(
200 ::std::vector<::std::string>
const& tags,
205 MCNAPI
void _handleItemCraftedEvents(
207 ::std::vector<short>
const& ingredientIds,
213 MCNAPI
void _handleTransferCraftExtraResults(::std::vector<::ItemInstance>& allResults);
215 MCNAPI ::CreateContainerItemScope _makeCreateItemScopeCrafting(
218 ::std::vector<::ItemInstance>& allResults
221 MCNAPI ::CreateContainerItemScope
224 MCNAPI
void _updateCraftingResultItem();
227 autoCraftItem(
::SlotData const& recipeSlot, ::ItemCraftType craftAmount, ::std::vector<::AutoPlaceItem>
const&);
229 MCNAPI
void clearAllRecipes();
231 MCNAPI
void evacuateCraftingContainerToInventory(
233 ::std::vector<::AutoPlaceItem>
const& autoPlace
236 MCNAPI
int getBackgroundStyle(::std::string
const& containerName,
int collectionIndex)
const;
238 MCNAPI ::CraftableCountingData getCraftableCount(
::ItemInstance const& item);
240 MCNAPI ::std::string
const& getExpandoItemGroupName(::std::string
const& collectionName,
int collectionIndex);
242 MCNAPI
int getIndexForCreativeItem(::std::string
const& collectionName,
::ItemStackBase const& item)
const;
244 MCNAPI ::ItemInstance
const& getRecipeItem(::std::string
const& collectionName,
int collectionIndex)
const;
246 MCNAPI ::std::string
const& getSearchString()
const;
248 MCNAPI
void handleRecipeSelect(
249 ::std::string
const& collectionName,
252 ::std::vector<::AutoPlaceItem>
const& autoPlace
255 MCNAPI
bool isCreativeContainer(::std::string
const& containerName)
const;
257 MCNAPI
bool isExpandableItemFiltered(::std::string
const& collectionName,
int collectionIndex)
const;
259 MCNAPI
bool isTakeableContainer(::std::string
const& containerName)
const;
263 MCNAPI
void setOnItemExpandedCallback(::std::function<
void(::std::string
const&,
int,
int)> callback);
265 MCNAPI
void switchExpandoItem(::std::string
const& collectionName,
int collectionIndex);
273 MCNAPI
void* $ctor(::std::weak_ptr<::CraftingContainerManagerModel> containerManagerModel);
281 MCNAPI
bool $isOutputSlot(::std::string
const& collectionName)
const;
283 MCNAPI
bool $handleTakeAmount(
::SlotData const& dstSlot,
int amount,
::SlotData const& srcSlot);
293 MCNAPI
int $handleAutoPlace(
296 ::std::vector<::AutoPlaceItem>
const& autoPlaceOrder,
297 ::std::vector<::AutoPlaceResult>& destinations
300 MCNAPI
int $handleAutoPlaceStack(
303 ::std::vector<::AutoPlaceItem>
const& autoPlaceOrder,
304 ::std::vector<::AutoPlaceResult>& destinations
309 MCNAPI
void $handleSplitMultiple(
315 MCNAPI
bool $handleAddToStack(
::SlotData const& dstSlot,
::SlotData const& srcSlot, ::ItemTakeType type);
319 MCNAPI
void $closeContainers();
321 MCNAPI ::ItemStackBase
const& $getTakeableItemStackBase(
::SlotData const& slot)
const;