186 cRecipe *
MatchRecipe(
const cItem * a_CraftingGrid,
int a_GridWidth,
int a_GridHeight,
int a_GridStride,
const cRecipe * a_Recipe,
int a_OffsetX,
int a_OffsetY);
205 const cItem & a_NewItem,
206 const std::set<cItem, cItem::sItemCompare> & a_KnownItems
cCraftingGrid(const cCraftingGrid &a_Original)
void SetItem(int x, int y, ENUM_ITEM_TYPE a_ItemType, char a_ItemCount, short a_ItemHealth)
cItem * GetItems(void) const
void Dump(void)
Dumps the entire crafting grid using LOGD()
void CopyToItems(cItem *a_Items) const
Copies internal contents into the item array specified.
void ConsumeGrid(const cCraftingGrid &a_Grid)
Removes items in a_Grid from m_Items[] (used by cCraftingRecipe::ConsumeIngredients())
int GetHeight(void) const
cItem & GetItem(int x, int y) const
cItem & GetIngredient(int x, int y) const
void Dump(void)
Dumps the entire recipe using LOGD()
void SetIngredient(int x, int y, const cItem &a_Item)
void SetIngredient(int x, int y, ENUM_ITEM_TYPE a_ItemType, char a_ItemCount, short a_ItemHealth)
void ConsumeIngredients(cCraftingGrid &a_CraftingGrid)
Consumes ingredients from the crafting grid specified.
int GetIngredientsWidth(void) const
const cItem & GetResult(void) const
int GetIngredientsHeight(void) const
void SetResult(ENUM_ITEM_TYPE a_ItemType, char a_ItemCount, short a_ItemHealth)
cCraftingRecipe(const cCraftingGrid &a_CraftingGrid)
cCraftingGrid m_Ingredients
void SetResult(const cItem &a_Item)
The crafting recipes are the configurations to build a result item out of a set of ingredient items.
static const int MAX_GRID_HEIGHT
std::vector< cRecipeSlot > cRecipeSlots
void HandleFireworks(const cItem *a_CraftingGrid, cCraftingRecipes::cRecipe *a_Recipe, int a_GridStride, int a_OffsetX, int a_OffsetY)
Searches for anything firework related, and does the data setting if appropriate.
static const int MAX_GRID_WIDTH
void GetRecipe(cPlayer &a_Player, cCraftingGrid &a_CraftingGrid, cCraftingRecipe &a_Recipe)
Returns the recipe for current crafting grid.
void NormalizeIngredients(cRecipe *a_Recipe)
Moves the recipe to top-left corner, sets its MinWidth / MinHeight.
const std::map< AString, UInt32 > & GetRecipeNameMap()
Gets a map of all recipes with name and recipe id.
std::map< AString, UInt32 > m_RecipeNameMap
Mapping the minecraft recipe names to the internal cuberite recipe Ids.
bool IsNewCraftableRecipe(const cRecipe *a_Recipe, const cItem &a_NewItem, const std::set< cItem, cItem::sItemCompare > &a_KnownItems)
Checks if all ingredients of the a_Recipe are within the a_KnownItems list and if the a_NewItem is pa...
cRecipe * MatchRecipe(const cItem *a_CraftingGrid, int a_GridWidth, int a_GridHeight, int a_GridStride, const cRecipe *a_Recipe, int a_OffsetX, int a_OffsetY)
Checks if the grid matches the specified recipe, offset by the specified offsets.
cRecipe * GetRecipeById(UInt32 a_RecipeId)
Returns the recipe by id.
cRecipe * FindRecipeCropped(const cItem *a_CraftingGrid, int a_GridWidth, int a_GridHeight, int a_GridStride)
Same as FindRecipe, but the grid is guaranteed to be of minimal dimensions needed.
void HandleDyedLeather(const cItem *a_CraftingGrid, cCraftingRecipes::cRecipe *a_Recipe, int a_GridStride, int a_GridWidth, int a_GridHeight)
Searches for anything dye related for leather, calculates the appropriate color value,...
cRecipe * FindRecipe(const cItem *a_CraftingGrid, int a_GridWidth, int a_GridHeight)
Finds a recipe matching the crafting grid.
std::vector< cRecipe * > cRecipes
bool ParseItem(const AString &a_String, cItem &a_Item)
Parses an item string in the format "<ItemType>[^<Damage>]", returns true if successful.
bool ParseIngredient(const AString &a_String, cRecipe *a_Recipe)
Parses one ingredient and adds it to the specified recipe.
std::vector< UInt32 > FindNewRecipesForItem(const cItem &a_Item, const std::set< cItem, cItem::sItemCompare > &a_KnownItems)
Find recipes and returns the RecipeIds which contain the new item and all ingredients are in the know...
void PopulateRecipeNameMap(void)
Populates the RecipeNameMap.
void AddRecipeLine(int a_LineNum, const AString &a_RecipeLine)
Parses the recipe line and adds it into m_Recipes.
cRecipeSlots m_Ingredients