From 223967b80d783df1be2df5f74ddf198f373fbc57 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Tue, 12 Jun 2012 21:30:32 +0000 Subject: Added working crafting hooks HOOK_PRE_CRAFTING, HOOK_CRAFTING_NO_RECIPE and HOOK_POST_CRAFTING git-svn-id: http://mc-server.googlecode.com/svn/trunk@598 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/CraftingRecipes.h | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'source/CraftingRecipes.h') diff --git a/source/CraftingRecipes.h b/source/CraftingRecipes.h index 3d55a3476..8e4422b1c 100644 --- a/source/CraftingRecipes.h +++ b/source/CraftingRecipes.h @@ -14,6 +14,13 @@ +// fwd: cPlayer.h +class cPlayer; + + + + + class cCraftingGrid // tolua_export { // tolua_export public: @@ -26,7 +33,7 @@ public: int GetWidth (void) const {return m_Width; } int GetHeight(void) const {return m_Height; } cItem & GetItem (int x, int y) const; - void SetItem (int x, int y, ENUM_ITEM_ID a_ItemType, short a_ItemHealth, int a_ItemCount); + void SetItem (int x, int y, ENUM_ITEM_ID a_ItemType, int a_ItemCount, short a_ItemHealth); void SetItem (int x, int y, const cItem & a_Item); void Clear (void); @@ -65,15 +72,15 @@ public: int GetIngredientsHeight(void) const {return m_Ingredients.GetHeight(); } cItem & GetIngredient (int x, int y) const {return m_Ingredients.GetItem(x, y); } const cItem & GetResult (void) const {return m_Result; } - void SetResult (ENUM_ITEM_ID a_ItemType, short a_ItemHealth, int a_ItemCount); + void SetResult (ENUM_ITEM_ID a_ItemType, int a_ItemCount, short a_ItemHealth); void SetResult (const cItem & a_Item) { m_Result = a_Item; } - void SetIngredient (int x, int y, ENUM_ITEM_ID a_ItemType, short a_ItemHealth, int a_ItemCount) + void SetIngredient (int x, int y, ENUM_ITEM_ID a_ItemType, int a_ItemCount, short a_ItemHealth) { - m_Ingredients.SetItem(x, y, a_ItemType, a_ItemHealth, a_ItemCount); + m_Ingredients.SetItem(x, y, a_ItemType, a_ItemCount, a_ItemHealth); } void SetIngredient (int x, int y, const cItem & a_Item) @@ -108,7 +115,7 @@ public: ~cCraftingRecipes(); /// Returns the recipe for current crafting grid. Doesn't modify the grid. Clears a_Recipe if no recipe found. - void GetRecipe(const cCraftingGrid & a_CraftingGrid, cCraftingRecipe & a_Recipe); + void GetRecipe(const cPlayer * a_Player, const cCraftingGrid & a_CraftingGrid, cCraftingRecipe & a_Recipe); protected: -- cgit v1.2.3