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,
115 ::ll::TypedStorage<8, 16, ::std::weak_ptr<::CraftingContainerManagerModel>> mCraftingContainerManagerModel;
116 ::ll::TypedStorage<4, 4, int> mGridSize;
117 ::ll::TypedStorage<8, 8, ::Recipes*> mLevelRecipes;
118 ::ll::TypedStorage<8, 24, ::std::vector<::std::reference_wrapper<::Recipe const>>> mRecipes;
119 ::ll::TypedStorage<8, 8, ::Recipe const*> mCraftingRecipe;
120 ::ll::TypedStorage<8, 8, ::Recipe const*> mSelectedRecipe;
121 ::ll::TypedStorage<1, 1, bool> mDisplayingInvalidRecipe;
122 ::ll::TypedStorage<1, 1, bool> mClearInputGridOnChange;
123 ::ll::TypedStorage<8, 40, ::SlotData const> mCreatedItemOutputSlot;
124 ::ll::TypedStorage<8, 24, ::std::vector<::ItemStateData>> mSavedInventoryState;
125 ::ll::TypedStorage<8, 48, ::CraftingSessionInfo> mCraftingInformation;
126 ::ll::TypedStorage<8, 24, ::std::vector<::ItemStack>> mRemainingItems;
127 ::ll::TypedStorage<8, 128, ::ItemInstance> mResultPreviewItem;
128 ::ll::TypedStorage<8, 24, ::std::vector<::ItemInstance>> mAllResults;
129 ::ll::TypedStorage<8, 16, ::std::shared_ptr<bool>> mListenerLifeIndicator;
130 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::CraftingContainerManagerController::BlockChangeListener>>
131 mBlockChangeListener;
132 ::ll::TypedStorage<1, 1, bool> mCloseCraftingContainer;
133 ::ll::TypedStorage<1, 1, bool> mIsCrafting;
140 CraftingContainerManagerController();
147 virtual ~CraftingContainerManagerController() =
default;
149 virtual ~CraftingContainerManagerController() ;
153 virtual bool isOutputSlot(::std::string
const&)
const ;
155 virtual bool isOutputSlot(::std::string
const& collectionName)
const ;
161 virtual void handleTakeAmount(
::SlotData const& dstSlot,
int amount,
::SlotData const& srcSlot) ;
189 virtual int handleAutoPlace(
192 ::std::vector<::AutoPlaceItem>
const&,
193 ::std::vector<::AutoPlaceResult>&
196 virtual int handleAutoPlace(
199 ::std::vector<::AutoPlaceItem>
const& autoPlaceOrder,
200 ::std::vector<::AutoPlaceResult>& destinations
205 virtual int handleAutoPlaceStack(
208 ::std::vector<::AutoPlaceItem>
const&,
209 ::std::vector<::AutoPlaceResult>&
212 virtual int handleAutoPlaceStack(
215 ::std::vector<::AutoPlaceItem>
const& autoPlaceOrder,
216 ::std::vector<::AutoPlaceResult>& destinations
229 virtual void handleSplitMultiple(
249 virtual void closeContainers() ;
252 virtual ::ItemStackBase
const& getTakeableItemStackBase(
::SlotData const&)
const ;
254 virtual ::ItemStackBase
const& getTakeableItemStackBase(
::SlotData const& slot)
const ;
263 MCNAPI
explicit CraftingContainerManagerController(
264 ::std::weak_ptr<::CraftingContainerManagerModel> containerManagerModel
267 MCNAPI ::std::vector<::ItemInstance> _craftItem(
::ItemStackRequestScope const& requestScope, uchar craftCount);
269 MCNAPI
void _filterRecipes();
271 MCNAPI ::std::vector<::RecipeSearchResult>
272 _getRecipesForItem(
::ItemInstance const& recipeItem, ::std::vector<::std::string>
const& tags,
bool);
274 MCNAPI
void _handleItemCraftedEvents(
276 ::std::vector<short>
const& ingredientIds,
282 MCNAPI
void _handleTransferCraftExtraResults(::std::vector<::ItemInstance>& allResults);
284 MCNAPI
bool _inventoryContainsItemForRecipeInputSlot(::std::string
const& containerName,
int collectionIndex)
const;
286 MCNAPI ::CreateContainerItemScope _makeCreateItemScopeCrafting(
289 ::std::vector<::ItemInstance>& allResults
292 MCNAPI ::CreateContainerItemScope
295 MCNAPI
void _setupCallbacks();
297 MCNAPI
void _updateCraftingResultItem();
300 autoCraftItem(
::SlotData const& recipeSlot, ::ItemCraftType craftAmount, ::std::vector<::AutoPlaceItem>
const&);
302 MCNAPI
void clearAllRecipes();
304 MCNAPI
void evacuateCraftingContainerToInventory(
306 ::std::vector<::AutoPlaceItem>
const& autoPlace
309 MCNAPI
int getBackgroundStyle(::std::string
const& containerName,
int collectionIndex)
const;
311 MCNAPI ::CraftableCountingData getCraftableCount(
::ItemInstance const& item);
313 MCNAPI ::CraftingSessionInfo& getCraftingInformation();
315 MCNAPI ::Recipe
const* getCurrentRecipe()
const;
317 MCNAPI ::std::string
const& getExpandoItemGroupName(::std::string
const& collectionName,
int collectionIndex);
319 MCNAPI ::ItemInstance
const& getGhostItem(::std::string
const& collectionName,
int collectionIndex)
const;
321 MCNAPI
int getIndexForCreativeItem(::std::string
const& collectionName,
::ItemStackBase const& item)
const;
323 MCNAPI ::ItemInstance
const& getRecipeItem(::std::string
const& collectionName,
int collectionIndex)
const;
325 MCNAPI ::std::string
const& getSearchString()
const;
327 MCNAPI
void handleRecipeSelect(
328 ::std::string
const& collectionName,
331 ::std::vector<::AutoPlaceItem>
const& autoPlace
334 MCNAPI
bool hasIngredientSetChanged(
::ItemStack const& inHand);
336 MCNAPI
bool isCraftingTableValid(
float pickRange);
338 MCNAPI
bool isCreativeContainer(::std::string
const& containerName)
const;
340 MCNAPI
bool isExpandableItemFiltered(::std::string
const& collectionName,
int collectionIndex)
const;
342 MCNAPI
bool isTakeableContainer(::std::string
const& containerName)
const;
344 MCNAPI
void resetCraftingInformation();
346 MCNAPI
void setIsFiltering(
bool filtering);
350 MCNAPI
void setOnItemExpandedCallback(::std::function<
void(::std::string
const&,
int,
int)> callback);
352 MCNAPI
void setSearchString(::std::string
const& searchString);
354 MCNAPI
void switchExpandoItem(::std::string
const& collectionName,
int collectionIndex);
364 MCNAPI
void* $ctor(::std::weak_ptr<::CraftingContainerManagerModel> containerManagerModel);
378 MCNAPI
bool $isOutputSlot(::std::string
const& collectionName)
const;
380 MCNAPI
void $handleTakeAmount(
::SlotData const& dstSlot,
int amount,
::SlotData const& srcSlot);
390 MCNAPI
int $handleAutoPlace(
393 ::std::vector<::AutoPlaceItem>
const& autoPlaceOrder,
394 ::std::vector<::AutoPlaceResult>& destinations
397 MCNAPI
int $handleAutoPlaceStack(
400 ::std::vector<::AutoPlaceItem>
const& autoPlaceOrder,
401 ::std::vector<::AutoPlaceResult>& destinations
406 MCNAPI
void $handleSplitMultiple(
412 MCNAPI
void $handleAddToStack(
::SlotData const& dstSlot,
::SlotData const& srcSlot, ::ItemTakeType type);
416 MCNAPI
void $closeContainers();
418 MCNAPI ::ItemStackBase
const& $getTakeableItemStackBase(
::SlotData const& slot)
const;