From ba2dbaf4665a88d4c58b73a79bd774ed423fe318 Mon Sep 17 00:00:00 2001 From: Rubenwardy Date: Fri, 31 Aug 2012 14:09:41 +0100 Subject: Did support.lua - dynamic external mod support --- support.lua | 81 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 support.lua (limited to 'support.lua') diff --git a/support.lua b/support.lua new file mode 100644 index 0000000..41d23fe --- /dev/null +++ b/support.lua @@ -0,0 +1,81 @@ +-- RUBENFOOD MOD +-- A mod written by rubenwardy that adds +-- food to the minetest game +-- ====================================== +-- >> rubenfood/support.lua +-- adds support for other mods +-- adds items and aliases that are needed +-- ====================================== +-- [support] +-- ====================================== + +print "RubenFood [Support] - Initialising" +function node_implement(modname,n_ext,n_int,resultfunc) + if not minetest.get_modpath(modname) then + resultfunc() + else + minetest.register_alias(n_int,n_ext) + end +end + + + + + + + +print "RubenFood [Support] - Farming Mod" +node_implement("farming","farming:flour","rubenfood:flour",function() + minetest.register_craftitem("rubenfood:flour", { + description = "Flour", + inventory_image = "farming_flour.png", +}) +end) + +node_implement("farming","farming:strawberry_item","rubenfood:strawberry",function() +minetest.register_craftitem("rubenfood:strawberry", { + description = "Strawberry", + inventory_image = "farming_strawberry.png", + on_use = minetest.item_eat(2), +}) +end) + + + + + +print "RubenFood [Support] - Animal Mod" +node_implement("animalmaterials","animalmaterials:glass","rubenfood:cup",function() + minetest.register_craftitem("rubenfood:cup",{ + description = "Glass", + tiles = {"ruben_cup.png"}, + inventory_image = "ruben_cup.png", +}) +end) + +node_implement("animalmaterials","animalmaterials:egg","rubenfood:egg",function() + minetest.register_craftitem("rubenfood:egg", { + description = "Egg", + image = "animalmaterials_egg.png", + stack_max=10 +}) +end) + +node_implement("animalmaterials","animalmaterials:milk","rubenfood:milk",function() + minetest.register_craftitem("rubenfood:milk", { + description = "Milk", + image = "animalmaterials_milk.png", + on_use = minetest.item_eat(1), + groups = { eatable=1 }, + stack_max=10 +}) +end) + + + + + + + + + -- cgit v1.2.3