From a4a3c2b69a55ed2ca9717db7d6ae2dd9435fdcc8 Mon Sep 17 00:00:00 2001 From: RealBadAngel Date: Sat, 2 Feb 2013 11:12:10 +0100 Subject: Merged Unified Inventory into Technic modpack --- aaa_recipeshook/depends.txt | 1 + aaa_recipeshook/init.lua | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 aaa_recipeshook/depends.txt create mode 100644 aaa_recipeshook/init.lua (limited to 'aaa_recipeshook') diff --git a/aaa_recipeshook/depends.txt b/aaa_recipeshook/depends.txt new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/aaa_recipeshook/depends.txt @@ -0,0 +1 @@ + diff --git a/aaa_recipeshook/init.lua b/aaa_recipeshook/init.lua new file mode 100644 index 0000000..733edd1 --- /dev/null +++ b/aaa_recipeshook/init.lua @@ -0,0 +1,29 @@ +crafts_table ={} +crafts_table_count=0 +UI_recipes_hook=true + +-- override minetest.register_craft +local minetest_register_craft = minetest.register_craft +minetest.register_craft = function (options) + register_craft(options) + if options.type=="alloy" or options.type=="grinding" then return end + minetest_register_craft(options) +end + +-- register_craft +register_craft = function(options) + if options.output == nil then + return + end + local itemstack = ItemStack(options.output) + if itemstack:is_empty() then + return + end + if crafts_table[itemstack:get_name()]==nil then + crafts_table[itemstack:get_name()] = {} + end + table.insert(crafts_table[itemstack:get_name()],options) + crafts_table_count=crafts_table_count+1 +end + + -- cgit v1.2.3