From 38662b0a192e4c5079668debef26ff8c5f6f560c Mon Sep 17 00:00:00 2001 From: Rubenwardy Date: Thu, 28 Mar 2013 17:28:10 +0000 Subject: [PATCH] Texture fixes and mod support fixes. --- init.lua | 191 +++--- support.lua | 564 +++++++++--------- textures/food_baked_potato.png | Bin 0 -> 321 bytes textures/food_cactus_slice.png | Bin 0 -> 726 bytes textures/food_potato.png | Bin 0 -> 252 bytes ...ken _raw.png => food_soup_chicken_raw.png} | Bin 6 files changed, 377 insertions(+), 378 deletions(-) create mode 100644 textures/food_baked_potato.png create mode 100644 textures/food_cactus_slice.png create mode 100644 textures/food_potato.png rename textures/{food_soup_chicken _raw.png => food_soup_chicken_raw.png} (100%) diff --git a/init.lua b/init.lua index 8f2c437..d8188ab 100644 --- a/init.lua +++ b/init.lua @@ -1,96 +1,95 @@ --- RUBENFOOD MOD --- A mod written by rubenwardy that adds --- food to the minetest game --- ===================================== --- >> rubenfood/init.lua --- inits the mod --- ===================================== --- [regis-item] Cup --- [craft] Cup --- [regis-food] Cigerette (-4) --- ===================================== - -print ("Food: Loading mainframe: [Master]") - -----------------------Load Files----------------------------- -dofile(minetest.get_modpath("food").."/support.lua") - -dofile(minetest.get_modpath("food").."/dairy.lua") -dofile(minetest.get_modpath("food").."/food/meats.lua") -dofile(minetest.get_modpath("food").."/food/sandwich.lua") -dofile(minetest.get_modpath("food").."/food/baking.lua") -dofile(minetest.get_modpath("food").."/food/soup.lua") - -dofile(minetest.get_modpath("food").."/snacks/crumbles.lua") -dofile(minetest.get_modpath("food").."/snacks/cakes.lua") -dofile(minetest.get_modpath("food").."/snacks/tarts.lua") - -dofile(minetest.get_modpath("food").."/drinks/juice.lua") -dofile(minetest.get_modpath("food").."/drinks/hot.lua") - - - -----------------------------Cup------------------------------ - -minetest.register_craftitem("food:mug",{ - description = "Mug", - inventory_image = "food_mug.png", -}) - -minetest.register_craftitem("food:clay_mug",{ - description = "Clay Mug", - inventory_image = "food_clay_mug.png", -}) - -minetest.register_craft({ - output = '"food:clay_mug" 1', - recipe = { - {"default:clay_lump","","default:clay_lump"}, - {"default:clay_lump","","default:clay_lump"}, - {"default:clay_lump","default:clay_lump","default:clay_lump"}, - } -}) - -minetest.register_craft({ - type = "cooking", - output = "food:mug", - recipe = "food:clay_mug", -}) - ------------------------------Bowl------------------------------- - -minetest.register_craftitem("food:bowl",{ - description = "Bowl", - inventory_image = "food_bowl.png", -}) - - ------------------------------Sugar------------------------------ -minetest.register_craftitem("food:sugar", { - description = "Sugar", - inventory_image = "food_sugar.png", -}) -minetest.register_craft({ - output = '"food:sugar" 20', - recipe = { - {'"default:papyrus"'}, - - } -}) - -----------------------------Cigerete---------------------------- -minetest.register_craftitem("food:cigarette", { - description = "Cigarette", - inventory_image = "food_cigar.png", - on_use = minetest.item_eat(-4), -}) - -minetest.register_craft({ - output = '"food:cigarette" 1', - recipe = { - {'"default:dry_shrub"','"default:dry_shrub"','"default:dry_shrub"'}, - - } -}) - -print("Food: Mainframe loaded") +-- RUBENFOOD MOD +-- A mod written by rubenwardy that adds +-- food to the minetest game +-- ===================================== +-- >> rubenfood/init.lua +-- inits the mod +-- ===================================== +-- [regis-item] Cup +-- [craft] Cup +-- [regis-food] Cigerette (-4) +-- ===================================== + +print ("Food: Loading mainframe: [Master]") + +----------------------Load Files----------------------------- +dofile(minetest.get_modpath("food").."/support.lua") + +dofile(minetest.get_modpath("food").."/dairy.lua") +dofile(minetest.get_modpath("food").."/food/meats.lua") +dofile(minetest.get_modpath("food").."/food/sandwich.lua") +dofile(minetest.get_modpath("food").."/food/baking.lua") +dofile(minetest.get_modpath("food").."/food/soup.lua") + +dofile(minetest.get_modpath("food").."/snacks/crumbles.lua") +dofile(minetest.get_modpath("food").."/snacks/cakes.lua") +dofile(minetest.get_modpath("food").."/snacks/tarts.lua") + +dofile(minetest.get_modpath("food").."/drinks/juice.lua") +dofile(minetest.get_modpath("food").."/drinks/hot.lua") + + + +----------------------------Cup------------------------------ + +minetest.register_craftitem("food:mug",{ + description = "Mug", + inventory_image = "food_mug.png", +}) + +minetest.register_craftitem("food:clay_mug",{ + description = "Clay Mug", + inventory_image = "food_clay_mug.png", +}) + +minetest.register_craft({ + output = '"food:clay_mug" 1', + recipe = { + {"default:clay_lump","","default:clay_lump"}, + {"default:clay_lump","","default:clay_lump"}, + {"default:clay_lump","default:clay_lump","default:clay_lump"}, + } +}) + +minetest.register_craft({ + type = "cooking", + output = "food:mug", + recipe = "food:clay_mug", +}) + +-----------------------------Bowl------------------------------- + +minetest.register_craftitem("food:bowl",{ + description = "Bowl", + inventory_image = "food_bowl.png", +}) + + +-----------------------------Sugar------------------------------ +minetest.register_craftitem("food:sugar", { + description = "Sugar", + inventory_image = "food_sugar.png", +}) +minetest.register_craft({ + output = '"food:sugar" 20', + recipe = { + {'"default:papyrus"'}, + + } +}) + +--------------------------Cactus Slice-------------------------- +minetest.register_craftitem("food:cactus_slice", { + description = "Cactus Slice", + inventory_image = "food_cactus_slice.png", + on_use = minetest.item_eat(2), +}) +minetest.register_craft({ + output = '"food:cactus_slice" 4', + recipe = { + {'"default:cactus"'}, + + } +}) + +print("Food: Mainframe loaded") diff --git a/support.lua b/support.lua index e633fed..94144cb 100644 --- a/support.lua +++ b/support.lua @@ -1,282 +1,282 @@ --- RUBENFOOD MOD --- A mod written by rubenwardy that adds --- food to the minetest game --- ====================================== --- >> rubenfood/support.lua --- adds support for other mods --- ====================================== --- [support] --- ====================================== - -print "Food [Support] - Initialising" - ---NODE_IMPLEMENT() Gets an item from another mod softly --- modname: the name of the mod that the item will be got from --- n_ext: the name of the item that we want to get --- n_int: the name we want to save the item so we can load it as an ingredient --- resultfunc: if the mod does not exist, then do this function -function node_implement(modname,n_ext,n_int,resultfunc) - if not minetest.get_modpath(modname) then - -- Mod is NOT installed - resultfunc() - else - -- Mod IS installed - minetest.register_alias(n_int,n_ext) - end -end - - - - - - -print "Food [Support] - Vegetables and Fruit" -print "Food [Support] - > Bread and Flour" - -node_implement("farming","farming:flour","food:flour",function() -node_implement("plantlib","plantlib:wheat","food:wheat",function() - -end) -minetest.register_craftitem("food:flour", { - description = "Flour", - inventory_image = "farming_flour.png", -}) -minetest.register_craft({ - output = '"food:flour" 1', - recipe = { - {"food:wheat"}, - } -}) -end) - -node_implement("farming","farming:bread","food:bread",function() - - - -minetest.register_craftitem("food:bread", { - description = "Bread", - inventory_image = "food_bread.png", - stack_max = 1, - on_use = minetest.item_eat(10), - groups={food=2}, -}) -minetest.register_craft({ - output = "food:dough", - type = "shapeless", - recipe = {"food:flour", "food:flour", "food:flour", "food:flour", "bucket:bucket_water"}, - replacements = {{"bucket:bucket_water", "bucket:bucket_empty"}}, -}) -minetest.register_craft({ - type = "cooking", - output = "food:bread", - recipe = "food:dough", - cooktime = 10, -}) - - - - -end) - - -node_implement("farming","farming:cake_mix","food:dough",function() -minetest.register_craftitem("food:dough", { - description = "Cake Mix", - inventory_image = "farming_cake_mix.png", -}) -end) - - - -print "Food [Support] - > Strawberry" - -node_implement("farming_plus","farming_plus:strawberry_item","food:strawberry",function() -node_implement("plantlib","plantlib:strawberry","food:strawberry",function() -minetest.register_craftitem("food:strawberry", { - description = "Strawberry", - inventory_image = "farming_strawberry.png", - on_use = minetest.item_eat(2), -}) -end) -end) - -print "Food [Support] - > Carrot" - -node_implement("farming_plus","farming_plus:carrot_item","food:carrot",function() -node_implement("docfarming","docfarming:carrot","food:carrot",function() -node_implement("plantlib","plantlib:carrot","food:carrot",function() -minetest.register_craftitem("food:carrot", { - description = "Carrot", - inventory_image = "farming_carrot.png", - on_use = minetest.item_eat(3), -}) -end) -end) -end) - - -print "Food [Support] - > Rhubarb" -node_implement("farming_plus","farming_plus:rhubarb_item","food:rhubarb",function() -minetest.register_craftitem("food:rhubarb", { - description = "Rhubarb", - inventory_image = "farming_rhubarb.png", -}) -end) - -print "Food [Support] - > Cocoa Bean" -node_implement("farming_plus","farming_plus:cocoa_bean","food:cocoa",function() -minetest.register_craftitem("food:cocoa", { - description = "Cocoa Bean", - inventory_image = "farming_cocoa_bean.png", -}) -end) - - -print "Food [Support] - > Banana" -node_implement("farming_plus","farming_plus:banana","food:banana",function() -minetest.register_node("food:banana", { - description = "Banana", - tiles = {"farming_banana.png"}, - inventory_image = "farming_banana.png", - wield_image = "farming_banana.png", - drawtype = "torchlike", - paramtype = "light", - sunlight_propagates = true, - walkable = false, - groups = {fleshy=3,dig_immediate=3,flammable=2}, - sounds = default.node_sound_defaults(), - on_use = minetest.item_eat(6), -}) -end) - -print "Food [Support] - > Tomato" -node_implement("farming_plus","farming_plus:tomato_item","food:tomato",function() -node_implement("plantlib","plantlib:tomato","food:tomato",function() -minetest.register_craftitem("food:tomato", { - description = "Tomato", - inventory_image = "farming_strawberry.png", - on_use = minetest.item_eat(2), -}) -end) -end) - -print "Food [Support] - > Potato" -node_implement("docfarming","docfarming:potato","food:potato",function() -minetest.register_craftitem("food:potato", { - description = "Potato", - inventory_image = "potato.png", -}) -end) - -node_implement("docfarming","docfarming:bakedpotato","food:potato_baked",function() -minetest.register_craftitem("food:potato_baked", { - description = "Baked Potato", - inventory_image = "baked_potato.png", - on_use = minetest.item_eat(6), -}) -end) - -print "Food [Support] - > Coffee" -node_implement("plantlib","plantlib:coffee","food:coffeebean",function() -minetest.register_craftitem("food:coffeebean",{ - description = "Raw Coffee Bean", - tiles = {"food_coffee.png"}, - inventory_image = "food_coffee.png", -}) - -minetest.register_craft({ - output = '"food:coffeebean" 1', - recipe = { - {'""','"default:dry_shrub"','""'}, - {'""','"default:dry_shrub"','""'}, - {'""','"default:dry_shrub"','""'}, - } -}) -end) - -print "Food [Support] - Meats and Animal Produce" - -print "Food [Support] - > Raw Meat" -node_implement("mobs","mobs:meat_raw","food:meat_raw",function() -node_implement("animalmaterials","animalmaterials:meat_raw","food:meat_raw",function() -minetest.register_craftitem("food:meat_raw", { - description = "Raw meat", - image = "animalmaterials_meat_raw.png", - on_use = minetest.item_eat(1), - groups = { meat=1, eatable=1 }, - stack_max=25 -}) -end) -end) - -print "Food [Support] - > Meat" -node_implement("mobs","mobs:meat","food:meat",function() -minetest.register_craftitem("food:meat", { - description = "Venison", - inventory_image = "food_meat.png", -}) - -minetest.register_craft({ - type = "cooking", - output = "food:meat", - recipe = "food:meat_raw", - cooktime = 20 -}) -end) - -node_implement("my_mobs","my_mobs:rabbit_cooked","food:rabbit",function() -node_implement("mobs","mobs:meat","food:rabbit",function() -minetest.register_craftitem("food:rabbit", { - description = "Cooked Rabbit", - inventory_image = "my_mobs_cooked_rabbit.png", - - on_use = minetest.item_eat(5), -}) -end) -end) - - -print "Food [Support] - > Egg" -node_implement("animalmaterials","animalmaterials:egg","food:egg",function() - minetest.register_craftitem("food:egg", { - description = "Egg", - image = "animalmaterials_egg.png", - stack_max=10 -}) -end) - -print "Food [Support] - > Milk" -node_implement("animalmaterials","animalmaterials:milk","food:milk",function() -node_implement("my_mobs","my_mobs:milk_glass_cup","food:milk",function() - minetest.register_craftitem("food:milk", { - description = "Milk", - image = "animalmaterials_milk.png", - on_use = minetest.item_eat(1), - groups = { eatable=1 }, - stack_max=10 -}) -end) -end) - -print "Food [Support] - Vessels and Cutlery" - -node_implement("vessels","vessels:drinking_glass","food:cup",function() -node_implement("animalmaterials","animalmaterials:glass","food:cup",function() - minetest.register_craftitem("food:cup",{ - description = "Glass", - tiles = {"food_cup.png"}, - inventory_image = "food_cup.png", -}) -end) -end) - - - - - - - - - - - +-- RUBENFOOD MOD +-- A mod written by rubenwardy that adds +-- food to the minetest game +-- ====================================== +-- >> rubenfood/support.lua +-- adds support for other mods +-- ====================================== +-- [support] +-- ====================================== + +print "Food [Support] - Initialising" + +--NODE_IMPLEMENT() Gets an item from another mod softly +-- modname: the name of the mod that the item will be got from +-- n_ext: the name of the item that we want to get +-- n_int: the name we want to save the item so we can load it as an ingredient +-- resultfunc: if the mod does not exist, then do this function +function node_implement(modname,n_ext,n_int,resultfunc) + if not minetest.get_modpath(modname) then + -- Mod is NOT installed + resultfunc() + else + -- Mod IS installed + minetest.register_alias(n_int,n_ext) + end +end + + + + + + +print "Food [Support] - Vegetables and Fruit" +print "Food [Support] - > Bread and Flour" + +node_implement("farming","farming:flour","food:flour",function() +node_implement("plantlib","plantlib:wheat","food:wheat",function() + +end) +minetest.register_craftitem("food:flour", { + description = "Flour", + inventory_image = "farming_flour.png", +}) +minetest.register_craft({ + output = '"food:flour" 1', + recipe = { + {"food:wheat"}, + } +}) +end) + +node_implement("farming","farming:bread","food:bread",function() + + + +minetest.register_craftitem("food:bread", { + description = "Bread", + inventory_image = "food_bread.png", + stack_max = 1, + on_use = minetest.item_eat(10), + groups={food=2}, +}) +minetest.register_craft({ + output = "food:dough", + type = "shapeless", + recipe = {"food:flour", "food:flour", "food:flour", "food:flour", "bucket:bucket_water"}, + replacements = {{"bucket:bucket_water", "bucket:bucket_empty"}}, +}) +minetest.register_craft({ + type = "cooking", + output = "food:bread", + recipe = "food:dough", + cooktime = 10, +}) + + + + +end) + + +node_implement("farming","farming:cake_mix","food:dough",function() +minetest.register_craftitem("food:dough", { + description = "Cake Mix", + inventory_image = "farming_cake_mix.png", +}) +end) + + + +print "Food [Support] - > Strawberry" + +node_implement("farming_plus","farming_plus:strawberry_item","food:strawberry",function() +node_implement("plantlib","plantlib:strawberry","food:strawberry",function() +minetest.register_craftitem("food:strawberry", { + description = "Strawberry", + inventory_image = "farming_strawberry.png", + on_use = minetest.item_eat(2), +}) +end) +end) + +print "Food [Support] - > Carrot" + +node_implement("farming_plus","farming_plus:carrot_item","food:carrot",function() +node_implement("docfarming","docfarming:carrot","food:carrot",function() +node_implement("plantlib","plantlib:carrot","food:carrot",function() +minetest.register_craftitem("food:carrot", { + description = "Carrot", + inventory_image = "farming_carrot.png", + on_use = minetest.item_eat(3), +}) +end) +end) +end) + + +print "Food [Support] - > Rhubarb" +node_implement("farming_plus","farming_plus:rhubarb_item","food:rhubarb",function() +minetest.register_craftitem("food:rhubarb", { + description = "Rhubarb", + inventory_image = "farming_rhubarb.png", +}) +end) + +print "Food [Support] - > Cocoa Bean" +node_implement("farming_plus","farming_plus:cocoa_bean","food:cocoa",function() +minetest.register_craftitem("food:cocoa", { + description = "Cocoa Bean", + inventory_image = "farming_cocoa_bean.png", +}) +end) + + +print "Food [Support] - > Banana" +node_implement("farming_plus","farming_plus:banana","food:banana",function() +minetest.register_node("food:banana", { + description = "Banana", + tiles = {"farming_banana.png"}, + inventory_image = "farming_banana.png", + wield_image = "farming_banana.png", + drawtype = "torchlike", + paramtype = "light", + sunlight_propagates = true, + walkable = false, + groups = {fleshy=3,dig_immediate=3,flammable=2}, + sounds = default.node_sound_defaults(), + on_use = minetest.item_eat(6), +}) +end) + +print "Food [Support] - > Tomato" +node_implement("farming_plus","farming_plus:tomato_item","food:tomato",function() +node_implement("plantlib","plantlib:tomato","food:tomato",function() +minetest.register_craftitem("food:tomato", { + description = "Tomato", + inventory_image = "farming_strawberry.png", + on_use = minetest.item_eat(2), +}) +end) +end) + +print "Food [Support] - > Potato" +node_implement("docfarming","docfarming:potato","food:potato",function() +minetest.register_craftitem("food:potato", { + description = "Potato", + inventory_image = "food_potato.png", +}) +end) + +node_implement("docfarming","docfarming:bakedpotato","food:potato_baked",function() +minetest.register_craftitem("food:potato_baked", { + description = "Baked Potato", + inventory_image = "food_baked_potato.png", + on_use = minetest.item_eat(6), +}) +end) + +print "Food [Support] - > Coffee" +node_implement("plantlib","plantlib:coffee","food:coffeebean",function() +minetest.register_craftitem("food:coffeebean",{ + description = "Raw Coffee Bean", + tiles = {"food_coffee.png"}, + inventory_image = "food_coffee.png", +}) + +minetest.register_craft({ + output = '"food:coffeebean" 1', + recipe = { + {'""','"default:dry_shrub"','""'}, + {'""','"default:dry_shrub"','""'}, + {'""','"default:dry_shrub"','""'}, + } +}) +end) + +print "Food [Support] - Meats and Animal Produce" + +print "Food [Support] - > Raw Meat" +node_implement("mobs","mobs:meat_raw","food:meat_raw",function() +node_implement("animalmaterials","animalmaterials:meat_raw","food:meat_raw",function() +minetest.register_craftitem("food:meat_raw", { + description = "Raw meat", + image = "animalmaterials_meat_raw.png", + on_use = minetest.item_eat(1), + groups = { meat=1, eatable=1 }, + stack_max=25 +}) +end) +end) + +print "Food [Support] - > Meat" +node_implement("mobs","mobs:meat","food:meat",function() +minetest.register_craftitem("food:meat", { + description = "Venison", + inventory_image = "food_meat.png", +}) + +minetest.register_craft({ + type = "cooking", + output = "food:meat", + recipe = "food:meat_raw", + cooktime = 20 +}) +end) + +node_implement("my_mobs","my_mobs:rabbit_cooked","food:rabbit",function() +node_implement("mobs","mobs:meat","food:rabbit",function() +minetest.register_craftitem("food:rabbit", { + description = "Cooked Rabbit", + inventory_image = "my_mobs_cooked_rabbit.png", + + on_use = minetest.item_eat(5), +}) +end) +end) + + +print "Food [Support] - > Egg" +node_implement("animalmaterials","animalmaterials:egg","food:egg",function() + minetest.register_craftitem("food:egg", { + description = "Egg", + image = "animalmaterials_egg.png", + stack_max=10 +}) +end) + +print "Food [Support] - > Milk" +node_implement("animalmaterials","animalmaterials:milk","food:milk",function() +node_implement("my_mobs","my_mobs:milk_glass_cup","food:milk",function() + minetest.register_craftitem("food:milk", { + description = "Milk", + image = "animalmaterials_milk.png", + on_use = minetest.item_eat(1), + groups = { eatable=1 }, + stack_max=10 +}) +end) +end) + +print "Food [Support] - Vessels and Cutlery" + +node_implement("vessels","vessels:drinking_glass","food:cup",function() +node_implement("animalmaterials","animalmaterials:glass","food:cup",function() + minetest.register_craftitem("food:cup",{ + description = "Glass", + tiles = {"food_cup.png"}, + inventory_image = "food_cup.png", +}) +end) +end) + + + + + + + + + + + diff --git a/textures/food_baked_potato.png b/textures/food_baked_potato.png new file mode 100644 index 0000000000000000000000000000000000000000..425c4ae333ad4629fac7095108ebc6fc043656af GIT binary patch literal 321 zcmV-H0lxl;P)o#s5c-QvbhvnFBV6pi5vjf;1dI z?giEi!nbb4{=axJ{BQP$7!J}rD~$oW?Hg+$ z27qjX8C2uJ@PA4I!~X+4I5fflNC7Bh8+;i4cZD(hZwX-dU+>NEe`YGg)&)5X_@i!9 z9mD@^O%TP4^BMk6OM=iKgK9k)h>LfS29T3MPMw|%!6YZy?r?_x`PO7;Bo_bxNuTQ` TQlETq00000NkvXXu0mjfmmPU!N$El zvzr}qhWZeUaa!bu;Ey3xNDR0TD5Ixbxza0x#|emQ!+fuUX@G4&>kP>69YwSa5JxGN zQ859ofD|FsAOccA@Dy=G$N|JbqY38Wmkvc+i~Nw$>YXn2UkEk&vc~lQ;t-#sj(7rU z8dDn3z#4(s)fwtTs1G1j5InrS{+VzD$txhh`rSS`f=L0^?({H@=q7ZwwFjRF1E`K5 z4B<(4mJ|UCVwJ(d_YUGfE<6KMLfJ;LA^CClP-!PIU>&$ga7{pv4>!9!|2acB4Q6Y$ zkFkh2k}*(}x}aD?wGX2`-GQ;1vjsf=F@r1h&n#?ra81Z#-9v<&V0B@QID+-%kEEb~ zN(n*6UI9$&G}sbygq3Sw2}8|2+gzlWgvEDH)kqP11<~W)-{}4aluNH51;h_Y^#R0@ zb`yaZ;QjqgmcGqn3y>4q1-59BTnps#Ylt4I1E}}O(SvJ%od7Fp;grXws#HeXhH?Ti zZY*OshB$=ik*!Bvkpgi|D5ju11?4mpEv39Q*CQT7b%+`K0lD}>_4Y$W7proWQ;2P0 z1$AExV_zKU$jL)@sgF6{)g$^c-^VqfXv0RQN6ustAy!B=KtiSN6@%oYmw5GM2Q%7L zYLB-&G^U}Pg5_WLaHTG@K7_SfeX4!%1Nb!8CysPyJ8$~@1D_Ke@}7IPy#N3J07*qo IM6N<$g7R%P3jhEB literal 0 HcmV?d00001 diff --git a/textures/food_potato.png b/textures/food_potato.png new file mode 100644 index 0000000000000000000000000000000000000000..6e91d6ae8949445d7edba0c3cc8c5f542e93b011 GIT binary patch literal 252 zcmV