Did support.lua - dynamic external mod support

This commit is contained in:
Rubenwardy 2012-08-31 14:09:41 +01:00
parent 39b6184a87
commit ba2dbaf466
28 changed files with 83 additions and 14 deletions

View File

@ -3,12 +3,8 @@
-- food to the minetest game
-- ======================================
-- >> rubenfood/support.lua
-- adds support for other mods
-- adds items and aliases that are needed
-- adds diary products
-- ======================================
-- [regis-item] Flour
-- [regis-item] Milk
-- [regis-item] Egg
-- [regis-food] Cheese
-- [craft] Cheese
-- [regis-item] Butter

View File

@ -13,6 +13,7 @@
print ("RubenFood: Loading mainframe: [Master]")
----------------------Load Files-----------------------------
dofile(minetest.get_modpath("rubenfood").."/support.lua")
dofile(minetest.get_modpath("rubenfood").."/dairy.lua")
dofile(minetest.get_modpath("rubenfood").."/baking.lua")
@ -24,12 +25,6 @@ dofile(minetest.get_modpath("rubenfood").."/fruits.lua")
----------------------------Cup------------------------------
minetest.register_alias("rubenfood:cup","animalmaterials:glass")
minetest.register_craftitem(":animalmaterials:glass",{
description = "Cup",
tiles = {"ruben_cup.png"},
inventory_image = "ruben_cup.png",
})
minetest.register_craftitem("rubenfood:mug",{
description = "Mug",

View File

View File

@ -1,2 +0,0 @@
minetest.register_alias("rubenfood:milk","animalmaterials:milk")
minetest.register_alias("rubenfood:egg","animalmaterials:egg")

View File

@ -1 +0,0 @@
minetest.register_alias("rubenfood:flour","farming:flour")

81
support.lua Normal file
View File

@ -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)

View File

Before

Width:  |  Height:  |  Size: 672 B

After

Width:  |  Height:  |  Size: 672 B

View File

Before

Width:  |  Height:  |  Size: 559 B

After

Width:  |  Height:  |  Size: 559 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 343 B

BIN
textures/farming_flour.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 344 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 250 B

View File

Before

Width:  |  Height:  |  Size: 918 B

After

Width:  |  Height:  |  Size: 918 B

View File

Before

Width:  |  Height:  |  Size: 908 B

After

Width:  |  Height:  |  Size: 908 B

View File

Before

Width:  |  Height:  |  Size: 942 B

After

Width:  |  Height:  |  Size: 942 B

View File

Before

Width:  |  Height:  |  Size: 693 B

After

Width:  |  Height:  |  Size: 693 B

View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

Before

Width:  |  Height:  |  Size: 895 B

After

Width:  |  Height:  |  Size: 895 B

View File

Before

Width:  |  Height:  |  Size: 873 B

After

Width:  |  Height:  |  Size: 873 B

View File

Before

Width:  |  Height:  |  Size: 564 B

After

Width:  |  Height:  |  Size: 564 B

View File

Before

Width:  |  Height:  |  Size: 729 B

After

Width:  |  Height:  |  Size: 729 B

View File

Before

Width:  |  Height:  |  Size: 780 B

After

Width:  |  Height:  |  Size: 780 B

View File

Before

Width:  |  Height:  |  Size: 842 B

After

Width:  |  Height:  |  Size: 842 B

View File

Before

Width:  |  Height:  |  Size: 854 B

After

Width:  |  Height:  |  Size: 854 B