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() ;
152 virtual bool isOutputSlot(::std::string
const& collectionName)
const ;
154 virtual void handleTakeAmount(
::SlotData const& dstSlot,
int amount,
::SlotData const& srcSlot) ;
164 virtual int handleAutoPlace(
167 ::std::vector<::AutoPlaceItem>
const& autoPlaceOrder,
168 ::std::vector<::AutoPlaceResult>& destinations
171 virtual int handleAutoPlaceStack(
174 ::std::vector<::AutoPlaceItem>
const& autoPlaceOrder,
175 ::std::vector<::AutoPlaceResult>& destinations
180 virtual void handleSplitMultiple(
191 virtual void closeContainers() ;
193 virtual ::ItemStackBase
const& getTakeableItemStackBase(
::SlotData const& slot)
const ;
200 MCNAPI
explicit CraftingContainerManagerController(
201 ::std::weak_ptr<::CraftingContainerManagerModel> containerManagerModel
204 MCNAPI ::std::vector<::ItemInstance> _craftItem(
::ItemStackRequestScope const& requestScope, uchar craftCount);
206 MCNAPI
void _filterRecipes();
208 MCNAPI ::std::vector<::RecipeSearchResult>
209 _getRecipesForItem(
::ItemInstance const& recipeItem, ::std::vector<::std::string>
const& tags,
bool);
211 MCNAPI
void _handleItemCraftedEvents(
213 ::std::vector<short>
const& ingredientIds,
219 MCNAPI
void _handleTransferCraftExtraResults(::std::vector<::ItemInstance>& allResults);
221 MCNAPI
bool _inventoryContainsItemForRecipeInputSlot(::std::string
const& containerName,
int collectionIndex)
const;
223 MCNAPI ::CreateContainerItemScope _makeCreateItemScopeCrafting(
226 ::std::vector<::ItemInstance>& allResults
229 MCNAPI ::CreateContainerItemScope
232 MCNAPI
void _setupCallbacks();
234 MCNAPI
void _updateCraftingResultItem();
237 autoCraftItem(
::SlotData const& recipeSlot, ::ItemCraftType craftAmount, ::std::vector<::AutoPlaceItem>
const&);
239 MCNAPI
void clearAllRecipes();
241 MCNAPI
void evacuateCraftingContainerToInventory(
243 ::std::vector<::AutoPlaceItem>
const& autoPlace
246 MCNAPI
int getBackgroundStyle(::std::string
const& containerName,
int collectionIndex)
const;
248 MCNAPI ::CraftableCountingData getCraftableCount(
::ItemInstance const& item);
250 MCNAPI ::std::string
const& getExpandoItemGroupName(::std::string
const& collectionName,
int collectionIndex);
252 MCNAPI ::ItemInstance
const& getGhostItem(::std::string
const& collectionName,
int collectionIndex)
const;
254 MCNAPI
int getIndexForCreativeItem(::std::string
const& collectionName,
::ItemStackBase const& item)
const;
256 MCNAPI ::ItemInstance
const& getRecipeItem(::std::string
const& collectionName,
int collectionIndex)
const;
258 MCNAPI ::std::string
const& getSearchString()
const;
260 MCNAPI
void handleRecipeSelect(
261 ::std::string
const& collectionName,
264 ::std::vector<::AutoPlaceItem>
const& autoPlace
267 MCNAPI
bool isCreativeContainer(::std::string
const& containerName)
const;
269 MCNAPI
bool isExpandableItemFiltered(::std::string
const& collectionName,
int collectionIndex)
const;
271 MCNAPI
bool isTakeableContainer(::std::string
const& containerName)
const;
275 MCNAPI
void setOnItemExpandedCallback(::std::function<
void(::std::string
const&,
int,
int)> callback);
277 MCNAPI
void setSearchString(::std::string
const& searchString);
279 MCNAPI
void switchExpandoItem(::std::string
const& collectionName,
int collectionIndex);
287 MCNAPI
void* $ctor(::std::weak_ptr<::CraftingContainerManagerModel> containerManagerModel);
301 MCNAPI
bool $isOutputSlot(::std::string
const& collectionName)
const;
303 MCNAPI
void $handleTakeAmount(
::SlotData const& dstSlot,
int amount,
::SlotData const& srcSlot);
313 MCNAPI
int $handleAutoPlace(
316 ::std::vector<::AutoPlaceItem>
const& autoPlaceOrder,
317 ::std::vector<::AutoPlaceResult>& destinations
320 MCNAPI
int $handleAutoPlaceStack(
323 ::std::vector<::AutoPlaceItem>
const& autoPlaceOrder,
324 ::std::vector<::AutoPlaceResult>& destinations
329 MCNAPI
void $handleSplitMultiple(
335 MCNAPI
void $handleAddToStack(
::SlotData const& dstSlot,
::SlotData const& srcSlot, ::ItemTakeType type);
339 MCNAPI
void $closeContainers();
341 MCNAPI ::ItemStackBase
const& $getTakeableItemStackBase(
::SlotData const& slot)
const;