From bd6d4666abe20247437ede28f73955d413fe5e22 Mon Sep 17 00:00:00 2001 From: Novatux Date: Sat, 26 Oct 2013 11:25:28 +0200 Subject: Add a callback: minetest.register_on_craft(itemstack, player, old_craft_grid, craft_inv) and minetest.register_craft_predict(itemstack, player, old_craft_grid, craft_inv) --- src/script/cpp_api/s_item.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/script/cpp_api/s_item.h') diff --git a/src/script/cpp_api/s_item.h b/src/script/cpp_api/s_item.h index 0f2b16042..4964dd5b4 100644 --- a/src/script/cpp_api/s_item.h +++ b/src/script/cpp_api/s_item.h @@ -29,6 +29,8 @@ class ServerActiveObject; struct ItemDefinition; class LuaItemStack; class ModApiItemMod; +class InventoryList; +class InventoryLocation; class ScriptApiItem : virtual public ScriptApiBase @@ -40,6 +42,10 @@ public: ServerActiveObject *placer, const PointedThing &pointed); bool item_OnUse(ItemStack &item, ServerActiveObject *user, const PointedThing &pointed); + bool item_OnCraft(ItemStack &item, ServerActiveObject *user, + const InventoryList *old_craft_grid, const InventoryLocation &craft_inv); + bool item_CraftPredict(ItemStack &item, ServerActiveObject *user, + const InventoryList *old_craft_grid, const InventoryLocation &craft_inv); protected: friend class LuaItemStack; -- cgit v1.2.3